]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stats: display new curr_sess_idle_conns server counter
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 28 Aug 2025 16:14:23 +0000 (18:14 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 28 Aug 2025 16:58:11 +0000 (18:58 +0200)
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.

doc/management.txt
src/stats-html.c
src/stats-proxy.c

index 945aef8f4ef3876287e0aab0ba2fa7a25ad4dd99..3766b6f63e20a9bc86c96fad680bea1de0f37dea 100644 (file)
@@ -1356,6 +1356,7 @@ Here is the list of static fields using the proxy statistics domain:
  111. h3req [.F..]: total number of HTTP/3 sessions processed by this object
       since the worker process started
  112. proto [L...]: protocol
+ 113. priv_idle_cur [...S]: current number of private idle connections
 
 For all other statistics domains, the presence or the order of the fields are
 not guaranteed. In this case, the header line should always be used to parse
index e533535a869158aa5e7c1b5fdb12fbb1e1228b1a..b18d64195b8da7adc84257c29376233324d58dd9 100644 (file)
@@ -887,6 +887,7 @@ int stats_dump_fields_html(struct buffer *out,
                                "<tr><th>- unsafe:</th><td>%s</td></tr>"
                                "<tr><th>- safe:</th><td>%s</td></tr>"
                                "<tr><th>Estimated need of connections:</th><td>%s</td></tr>"
+                               "<tr><th>Private idle connections:</th><td>%s</td></tr>"
                                "<tr><th>Active connections limit:</th><td>%s</td></tr>"
                                "<tr><th>Idle connections limit:</th><td>%s</td></tr>"
                                "</table></div></u>"
@@ -901,6 +902,7 @@ int stats_dump_fields_html(struct buffer *out,
                              U2H(stats[ST_I_PX_IDLE_CONN_CUR].u.u32),
                              U2H(stats[ST_I_PX_SAFE_CONN_CUR].u.u32),
                              U2H(stats[ST_I_PX_NEED_CONN_EST].u.u32),
+                             U2H(stats[ST_I_PX_PRIV_IDLE_CUR].u.u32),
 
                                LIM2A(stats[ST_I_PX_SLIM].u.u32, "-"),
                                stats[ST_I_PX_SRV_ILIM].type ? U2H(stats[ST_I_PX_SRV_ILIM].u.u32) : "-",
index 03a19e5288f89405f4127bd6c72e09f36ba8c6f6..81d3fb43aa1aa99e15181a2997dd95ae51ae47fd 100644 (file)
@@ -191,6 +191,7 @@ const struct stat_col stat_cols_px[ST_I_PX_MAX] = {
        [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"),
        [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"),
        [ST_I_PX_PROTO]                         = { .name = "proto",                       .alt_name = NULL,                              .desc = "Protocol" },
+       [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},
 };
 
 /* 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,
                                if (flags & STAT_F_SHLGNDS && sv->cookie)
                                        field = mkf_str(FO_CONFIG|FN_NAME|FS_SERVICE, sv->cookie);
                                break;
+                       case ST_I_PX_PRIV_IDLE_CUR:
+                               field = mkf_u32(0, sv->curr_sess_idle_conns);
+                               break;
                        default:
                                /* not used for servers. If a specific field
                                 * is requested, return an error. Otherwise continue.