mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-21 22:28:41 -04:00
MINOR: counters: Remove bytes_in and bytes_out counter from fe/be/srv/li
bytes_in and bytes_out counters per frontend, backend, listener and server were removed and we now rely on, respectively on, req_in and res_in counters. This patch is related to issue #1617.
This commit is contained in:
parent
567df50d91
commit
0084baa6ba
3 changed files with 10 additions and 28 deletions
|
|
@ -49,8 +49,6 @@
|
|||
long long req_out; /* number of bytes sent to the server */\
|
||||
long long res_in; /* number of bytes received from the server */\
|
||||
long long res_out; /* number of bytes sent to the client */\
|
||||
long long bytes_out; /* number of bytes transferred from the server to the client */\
|
||||
long long bytes_in; /* number of bytes transferred from the client to the server */\
|
||||
long long denied_resp; /* blocked responses because of security concerns */\
|
||||
long long denied_req; /* blocked requests because of security concerns */\
|
||||
long long cum_sess; /* cumulated number of accepted connections */\
|
||||
|
|
|
|||
|
|
@ -85,8 +85,8 @@ const struct stat_col stat_cols_px[ST_I_PX_MAX] = {
|
|||
[ST_I_PX_SMAX] = { .name = "smax", .alt_name = "max_sessions", .desc = "Highest value of current sessions encountered since process started", .cap = STATS_PX_CAP_LFBS },
|
||||
[ST_I_PX_SLIM] = { .name = "slim", .alt_name = "limit_sessions", .desc = "Frontend/listener/server's maxconn, backend's fullconn", .cap = STATS_PX_CAP_LFBS },
|
||||
[ST_I_PX_STOT] = ME_NEW_PX_SHARED("stot", "sessions_total", FN_COUNTER, FF_U64, cum_sess, STATS_PX_CAP_LFBS, "Total number of sessions since process started"),
|
||||
[ST_I_PX_BIN] = ME_NEW_PX_SHARED("bin", "bytes_in_total", FN_COUNTER, FF_U64, bytes_in, STATS_PX_CAP_LFBS, "Total number of request bytes since process started"),
|
||||
[ST_I_PX_BOUT] = ME_NEW_PX_SHARED("bout", "bytes_out_total", FN_COUNTER, FF_U64, bytes_out, STATS_PX_CAP_LFBS, "Total number of response bytes since process started"),
|
||||
[ST_I_PX_BIN] = ME_NEW_PX_SHARED("bin", "bytes_in_total", FN_COUNTER, FF_U64, req_in, STATS_PX_CAP_LFBS, "Total number of request bytes since process started"),
|
||||
[ST_I_PX_BOUT] = ME_NEW_PX_SHARED("bout", "bytes_out_total", FN_COUNTER, FF_U64, res_in, STATS_PX_CAP_LFBS, "Total number of response bytes since process started"),
|
||||
[ST_I_PX_DREQ] = ME_NEW_PX_SHARED("dreq", "requests_denied_total", FN_COUNTER, FF_U64, denied_req, STATS_PX_CAP_LFB_, "Total number of denied requests since process started"),
|
||||
[ST_I_PX_DRESP] = ME_NEW_PX_SHARED("dresp", "responses_denied_total", FN_COUNTER, FF_U64, denied_resp, STATS_PX_CAP_LFBS, "Total number of denied responses since process started"),
|
||||
[ST_I_PX_EREQ] = ME_NEW_FE_SHARED("ereq", "request_errors_total", FN_COUNTER, FF_U64, failed_req, STATS_PX_CAP_LF__, "Total number of invalid requests since process started"),
|
||||
|
|
|
|||
32
src/stream.c
32
src/stream.c
|
|
@ -829,24 +829,16 @@ void stream_process_counters(struct stream *s)
|
|||
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->bytes_in, bytes);
|
||||
if (sess->fe_tgcounters)
|
||||
_HA_ATOMIC_ADD(&sess->fe_tgcounters->req_in, bytes);
|
||||
}
|
||||
if (s->be_tgcounters) {
|
||||
_HA_ATOMIC_ADD(&s->be_tgcounters->bytes_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->bytes_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->bytes_in, bytes);
|
||||
if (sess->li_tgcounters)
|
||||
_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))
|
||||
|
|
@ -872,24 +864,16 @@ void stream_process_counters(struct stream *s)
|
|||
bytes = s->scb->bytes_in - s->logs.res_in;
|
||||
s->logs.res_in = s->scb->bytes_in;
|
||||
if (bytes) {
|
||||
if (sess->fe_tgcounters) {
|
||||
_HA_ATOMIC_ADD(&sess->fe_tgcounters->bytes_out, bytes);
|
||||
if (sess->fe_tgcounters)
|
||||
_HA_ATOMIC_ADD(&sess->fe_tgcounters->res_in, bytes);
|
||||
}
|
||||
if (s->be_tgcounters) {
|
||||
_HA_ATOMIC_ADD(&s->be_tgcounters->bytes_out, bytes);
|
||||
if (s->be_tgcounters)
|
||||
_HA_ATOMIC_ADD(&s->be_tgcounters->res_in, bytes);
|
||||
}
|
||||
|
||||
if (s->sv_tgcounters) {
|
||||
_HA_ATOMIC_ADD(&s->sv_tgcounters->bytes_out, bytes);
|
||||
if (s->sv_tgcounters)
|
||||
_HA_ATOMIC_ADD(&s->sv_tgcounters->res_in, bytes);
|
||||
}
|
||||
|
||||
if (sess->li_tgcounters) {
|
||||
_HA_ATOMIC_ADD(&sess->li_tgcounters->bytes_out, bytes);
|
||||
if (sess->li_tgcounters)
|
||||
_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))
|
||||
|
|
|
|||
Loading…
Reference in a new issue