Skip to content

Commit fac1de9

Browse files
committed
MINOR: stats: display new curr_sess_idle_conns server counter
Add a new stats column in proxy stats to display server counter for private idle connections. This counter has been introduced recently. The value is displayed on CSV output on the last column before modules. It is also displayed on HTLM page alongside other idle server counters.
1 parent fb43343 commit fac1de9

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

doc/management.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,6 +1356,7 @@ Here is the list of static fields using the proxy statistics domain:
13561356
111. h3req [.F..]: total number of HTTP/3 sessions processed by this object
13571357
since the worker process started
13581358
112. proto [L...]: protocol
1359+
113. priv_idle_cur [...S]: current number of private idle connections
13591360

13601361
For all other statistics domains, the presence or the order of the fields are
13611362
not guaranteed. In this case, the header line should always be used to parse

src/stats-html.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,7 @@ int stats_dump_fields_html(struct buffer *out,
887887
"<tr><th>- unsafe:</th><td>%s</td></tr>"
888888
"<tr><th>- safe:</th><td>%s</td></tr>"
889889
"<tr><th>Estimated need of connections:</th><td>%s</td></tr>"
890+
"<tr><th>Private idle connections:</th><td>%s</td></tr>"
890891
"<tr><th>Active connections limit:</th><td>%s</td></tr>"
891892
"<tr><th>Idle connections limit:</th><td>%s</td></tr>"
892893
"</table></div></u>"
@@ -901,6 +902,7 @@ int stats_dump_fields_html(struct buffer *out,
901902
U2H(stats[ST_I_PX_IDLE_CONN_CUR].u.u32),
902903
U2H(stats[ST_I_PX_SAFE_CONN_CUR].u.u32),
903904
U2H(stats[ST_I_PX_NEED_CONN_EST].u.u32),
905+
U2H(stats[ST_I_PX_PRIV_IDLE_CUR].u.u32),
904906

905907
LIM2A(stats[ST_I_PX_SLIM].u.u32, "-"),
906908
stats[ST_I_PX_SRV_ILIM].type ? U2H(stats[ST_I_PX_SRV_ILIM].u.u32) : "-",

src/stats-proxy.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ const struct stat_col stat_cols_px[ST_I_PX_MAX] = {
191191
[ST_I_PX_H2REQ] = ME_NEW_FE_SHARED("h2req", NULL, FN_COUNTER, FF_U64, p.http.cum_req[2], STATS_PX_CAP__F__, "Total number of hTTP/2 sessions processed by this object since the worker process started"),
192192
[ST_I_PX_H3REQ] = ME_NEW_FE_SHARED("h3req", NULL, FN_COUNTER, FF_U64, p.http.cum_req[3], STATS_PX_CAP__F__, "Total number of HTTP/3 sessions processed by this object since the worker process started"),
193193
[ST_I_PX_PROTO] = { .name = "proto", .alt_name = NULL, .desc = "Protocol" },
194+
[ST_I_PX_PRIV_IDLE_CUR] = { .name = "priv_idle_cur", .alt_name = "private_idle_connections_current",.desc = "Current number of private idle connections", .cap = STATS_PX_CAP____S},
194195
};
195196

196197
/* Returns true if column at <idx> should be hidden.
@@ -1089,6 +1090,9 @@ int stats_fill_sv_line(struct proxy *px, struct server *sv, int flags,
10891090
if (flags & STAT_F_SHLGNDS && sv->cookie)
10901091
field = mkf_str(FO_CONFIG|FN_NAME|FS_SERVICE, sv->cookie);
10911092
break;
1093+
case ST_I_PX_PRIV_IDLE_CUR:
1094+
field = mkf_u32(0, sv->curr_sess_idle_conns);
1095+
break;
10921096
default:
10931097
/* not used for servers. If a specific field
10941098
* is requested, return an error. Otherwise continue.

0 commit comments

Comments
 (0)