also the "cur_tunnel_timeout".
bytes_in : integer
- This returns the number of bytes uploaded from the client to the server. The
- value corresponds to what was received by HAProxy, including some headers and
- some internal encoding overhead. Request compression does not affect the
- value reported here.
+ See "req.in".
bytes_out : integer
- This is the number of bytes transmitted from the server to the client. The
- value corresponds to what was received by HAProxy, including some headers and
- some internal encoding overhead. Response compression does not affect the
- value reported here.
+ See "res.in".
cur_client_timeout : integer
Returns the currently applied client timeout in millisecond for the stream.
| Others |
+---+------+------------------------------------------------------+---------+
| | %B | bytes_read (from server to client) | numeric |
- | | | %[bytes_out] | |
+ | | | %[res_in] | |
+---+------+------------------------------------------------------+---------+
| H | %CC | captured_request_cookie | string |
+---+------+------------------------------------------------------+---------+
| | | %[txn.status] | |
+---+------+------------------------------------------------------+---------+
| | %U | bytes_uploaded (from client to server) | numeric |
- | | | %[bytes_in] | |
+ | | | %[req_in] | |
+---+------+------------------------------------------------------+---------+
| | %ac | actconn | |
| | | %[act_conn] | numeric |
tmp_strm_log.t_connect = -1;
tmp_strm_log.t_data = -1;
tmp_strm_log.t_close = ns_to_ms(now_ns - sess->accept_ts);
- tmp_strm_log.bytes_in = 0;
- tmp_strm_log.bytes_out = 0;
+ tmp_strm_log.req_in = tmp_strm_log.req_out = 0;
+ tmp_strm_log.res_in = tmp_strm_log.res_out = 0;
tmp_strm_log.prx_queue_pos = 0;
tmp_strm_log.srv_queue_pos = 0;
case LOG_FMT_BYTES: // %B
if (!(fe->to_log & LW_BYTES))
LOGMETACHAR('+');
- ret = lf_int(tmplog, dst + maxsize - tmplog, logs->bytes_out, ctx, LF_INT_LLTOA);
+ ret = lf_int(tmplog, dst + maxsize - tmplog, logs->req_in, ctx, LF_INT_LLTOA);
if (ret == NULL)
goto out;
tmplog = ret;
break;
case LOG_FMT_BYTES_UP: // %U
- ret = lf_int(tmplog, dst + maxsize - tmplog, logs->bytes_in, ctx, LF_INT_LLTOA);
+ ret = lf_int(tmplog, dst + maxsize - tmplog, logs->res_out, ctx, LF_INT_LLTOA);
if (ret == NULL)
goto out;
tmplog = ret;
s->logs.t_close = 0;
s->logs.req_in = s->logs.req_out = 0;
s->logs.res_in = s->logs.res_out = 0;
- s->logs.bytes_in = s->logs.bytes_out = 0;
s->logs.prx_queue_pos = 0; /* we get the number of pending conns before us */
s->logs.srv_queue_pos = 0; /* we will get this number soon */
s->obj_type = OBJ_TYPE_STREAM;
unsigned long long bytes;
int i;
- bytes = s->req.total - s->logs.bytes_in;
- s->logs.bytes_in = s->req.total;
+ bytes = s->scf->bytes_in - s->logs.req_in;
+ s->logs.req_in = s->scf->bytes_in;
if (bytes) {
- if (sess->fe_tgcounters)
+ if (sess->fe_tgcounters) {
_HA_ATOMIC_ADD(&sess->fe_tgcounters->bytes_in, bytes);
- if (s->be_tgcounters)
- _HA_ATOMIC_ADD(&s->be_tgcounters->bytes_in, bytes);
+ _HA_ATOMIC_ADD(&sess->fe_tgcounters->req_in, bytes);
+ }
+ if (s->be_tgcounters) {
+ _HA_ATOMIC_ADD(&s->be_tgcounters->bytes_in, bytes);
+ _HA_ATOMIC_ADD(&s->be_tgcounters->req_in, bytes);
+ }
- if (s->sv_tgcounters)
+ if (s->sv_tgcounters) {
_HA_ATOMIC_ADD(&s->sv_tgcounters->bytes_in, bytes);
+ _HA_ATOMIC_ADD(&s->sv_tgcounters->req_in, bytes);
+ }
- if (sess->li_tgcounters)
+ if (sess->li_tgcounters) {
_HA_ATOMIC_ADD(&sess->li_tgcounters->bytes_in, bytes);
+ _HA_ATOMIC_ADD(&sess->li_tgcounters->req_in, bytes);
+ }
for (i = 0; i < global.tune.nb_stk_ctr; i++) {
if (!stkctr_inc_bytes_in_ctr(&s->stkctr[i], bytes))
}
}
- bytes = s->res.total - s->logs.bytes_out;
- s->logs.bytes_out = s->res.total;
- if (bytes) {
- if (sess->fe_tgcounters)
- _HA_ATOMIC_ADD(&sess->fe_tgcounters->bytes_out, bytes);
- if (s->be_tgcounters)
- _HA_ATOMIC_ADD(&s->be_tgcounters->bytes_out, bytes);
-
- if (s->sv_tgcounters)
- _HA_ATOMIC_ADD(&s->sv_tgcounters->bytes_out, bytes);
-
- if (sess->li_tgcounters)
- _HA_ATOMIC_ADD(&sess->li_tgcounters->bytes_out, bytes);
-
- for (i = 0; i < global.tune.nb_stk_ctr; i++) {
- if (!stkctr_inc_bytes_out_ctr(&s->stkctr[i], bytes))
- stkctr_inc_bytes_out_ctr(&sess->stkctr[i], bytes);
- }
- }
-
- bytes = s->scf->bytes_in - s->logs.req_in;
- s->logs.req_in = s->scf->bytes_in;
- if (bytes) {
- if (sess->fe_tgcounters)
- _HA_ATOMIC_ADD(&sess->fe_tgcounters->req_in, bytes);
- if (s->be_tgcounters)
- _HA_ATOMIC_ADD(&s->be_tgcounters->req_in, bytes);
-
- if (s->sv_tgcounters)
- _HA_ATOMIC_ADD(&s->sv_tgcounters->req_in, bytes);
-
- if (sess->li_tgcounters)
- _HA_ATOMIC_ADD(&sess->li_tgcounters->req_in, bytes);
- }
-
bytes = s->scb->bytes_out - s->logs.req_out;
s->logs.req_out = s->scb->bytes_out;
if (bytes) {
bytes = s->scb->bytes_in - s->logs.res_in;
s->logs.res_in = s->scb->bytes_in;
if (bytes) {
- if (sess->fe_tgcounters)
+ if (sess->fe_tgcounters) {
+ _HA_ATOMIC_ADD(&sess->fe_tgcounters->bytes_out, bytes);
_HA_ATOMIC_ADD(&sess->fe_tgcounters->res_in, bytes);
- if (s->be_tgcounters)
+ }
+ if (s->be_tgcounters) {
+ _HA_ATOMIC_ADD(&s->be_tgcounters->bytes_out, bytes);
_HA_ATOMIC_ADD(&s->be_tgcounters->res_in, bytes);
+ }
- if (s->sv_tgcounters)
+ if (s->sv_tgcounters) {
+ _HA_ATOMIC_ADD(&s->sv_tgcounters->bytes_out, bytes);
_HA_ATOMIC_ADD(&s->sv_tgcounters->res_in, bytes);
+ }
- if (sess->li_tgcounters)
+ if (sess->li_tgcounters) {
+ _HA_ATOMIC_ADD(&sess->li_tgcounters->bytes_out, bytes);
_HA_ATOMIC_ADD(&sess->li_tgcounters->res_in, bytes);
+ }
+
+ for (i = 0; i < global.tune.nb_stk_ctr; i++) {
+ if (!stkctr_inc_bytes_out_ctr(&s->stkctr[i], bytes))
+ stkctr_inc_bytes_out_ctr(&sess->stkctr[i], bytes);
+ }
}
bytes = s->scf->bytes_out - s->logs.res_out;