From: Willy Tarreau Date: Fri, 21 Oct 2016 16:16:27 +0000 (+0200) Subject: MINOR: stats: emit dses X-Git-Tag: v1.7-dev5~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a5bc36b31c8789ae252d98d8aea5c099040b552b;p=thirdparty%2Fhaproxy.git MINOR: stats: emit dses This is the number of denied sessions, blocked by "tcp-request session reject". --- diff --git a/doc/management.txt b/doc/management.txt index d9aee31e6d..2a0c5877ed 100644 --- a/doc/management.txt +++ b/doc/management.txt @@ -1036,6 +1036,7 @@ S (Servers). 79: conn_tot [.F..]: cumulative number of connections 80: intercepted [.FB.]: cum. number of intercepted requests (monitor, stats) 81: dcon [LF..]: requests denied by "tcp-request connection" rules + 82: dses [LF..]: requests denied by "tcp-request session" rules 9.2) Typed output format diff --git a/include/proto/dumpstats.h b/include/proto/dumpstats.h index 633beca1d3..db60bab83b 100644 --- a/include/proto/dumpstats.h +++ b/include/proto/dumpstats.h @@ -205,6 +205,7 @@ enum stat_field { ST_F_CONN_TOT, ST_F_INTERCEPTED, ST_F_DCON, + ST_F_DSES, /* must always be the last one */ ST_F_TOTAL_FIELDS diff --git a/src/dumpstats.c b/src/dumpstats.c index a564ab3d09..4647fb8491 100644 --- a/src/dumpstats.c +++ b/src/dumpstats.c @@ -218,6 +218,7 @@ const char *stat_field_names[ST_F_TOTAL_FIELDS] = { [ST_F_CONN_TOT] = "conn_tot", [ST_F_INTERCEPTED] = "intercepted", [ST_F_DCON] = "dcon", + [ST_F_DSES] = "dses", }; /* one line of stats */ @@ -4017,6 +4018,7 @@ int stats_fill_fe_stats(struct proxy *px, struct field *stats, int len) stats[ST_F_DRESP] = mkf_u64(FN_COUNTER, px->fe_counters.denied_resp); stats[ST_F_EREQ] = mkf_u64(FN_COUNTER, px->fe_counters.failed_req); stats[ST_F_DCON] = mkf_u64(FN_COUNTER, px->fe_counters.denied_conn); + stats[ST_F_DSES] = mkf_u64(FN_COUNTER, px->fe_counters.denied_sess); stats[ST_F_STATUS] = mkf_str(FO_STATUS, px->state == PR_STREADY ? "OPEN" : px->state == PR_STFULL ? "FULL" : "STOP"); stats[ST_F_PID] = mkf_u32(FO_KEY, relative_pid); stats[ST_F_IID] = mkf_u32(FO_KEY|FS_SERVICE, px->uuid); @@ -4109,6 +4111,7 @@ int stats_fill_li_stats(struct proxy *px, struct listener *l, int flags, stats[ST_F_DRESP] = mkf_u64(FN_COUNTER, l->counters->denied_resp); stats[ST_F_EREQ] = mkf_u64(FN_COUNTER, l->counters->failed_req); stats[ST_F_DCON] = mkf_u64(FN_COUNTER, l->counters->denied_conn); + stats[ST_F_DSES] = mkf_u64(FN_COUNTER, l->counters->denied_sess); stats[ST_F_STATUS] = mkf_str(FO_STATUS, (l->nbconn < l->maxconn) ? (l->state == LI_LIMITED) ? "WAITING" : "OPEN" : "FULL"); stats[ST_F_PID] = mkf_u32(FO_KEY, relative_pid); stats[ST_F_IID] = mkf_u32(FO_KEY|FS_SERVICE, px->uuid);