]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stats: report the number of thread groups in "show info"
authorWilly Tarreau <w@1wt.eu>
Tue, 14 Apr 2026 14:47:06 +0000 (16:47 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 14 Apr 2026 14:48:16 +0000 (16:48 +0200)
Since thread groups were enabled by default in 3.3, it has become an
important element of diagnostic that we're missing in "show info". Let's
add it under "NbThreadGroups".

include/haproxy/stats-t.h
src/stats.c

index 8323778cecb0505344022d850e8874ad1ff7a9af..1078f90f9ec86d48baac51f608803b32415c6bd6 100644 (file)
@@ -340,6 +340,7 @@ enum stat_idx_info {
        ST_I_INF_WARN_BLOCKED,
        ST_I_INF_PATTERNS_ADDED,
        ST_I_INF_PATTERNS_FREED,
+       ST_I_INF_NBTGROUPS,
 
        /* must always be the last one */
        ST_I_INF_MAX
index 4ce6d5e95308ebeca07c5957c69deda66c006318..09c3b1a08178f2055cbaf69061bc7bfb3314d79f 100644 (file)
@@ -174,6 +174,7 @@ const struct stat_col stat_cols_info[ST_I_INF_MAX] = {
        [ST_I_INF_WARN_BLOCKED]                   = { .name = "BlockedTrafficWarnings",      .alt_name = NULL,                            .desc = "Total number of warnings issued about traffic being blocked by too slow a task" },
        [ST_I_INF_PATTERNS_ADDED]                 = { .name = "PatternsAdded",               .alt_name = "patterns_added_total",          .desc = "Total number of patterns added (acl/map entries)" },
        [ST_I_INF_PATTERNS_FREED]                 = { .name = "PatternsFreed",               .alt_name = "patterns_freed_total",          .desc = "Total number of patterns freed (acl/map entries)" },
+       [ST_I_INF_NBTGROUPS]                      = { .name = "NbThreadGroups",              .alt_name = "nb_thread_groups",              .desc = "Number of started thread groups (global.thread-groups)" },
 };
 
 /* one line of info */
@@ -841,6 +842,7 @@ int stats_fill_info(struct field *line, int len, uint flags)
        line[ST_I_INF_WARN_BLOCKED]                   = mkf_u32(0, warn_blocked_issued);
        line[ST_I_INF_PATTERNS_ADDED]                 = mkf_u64(0, patterns_added);
        line[ST_I_INF_PATTERNS_FREED]                 = mkf_u64(0, patterns_freed);
+       line[ST_I_INF_NBTGROUPS]                      = mkf_u32(FO_CONFIG|FS_SERVICE, global.nbtgroups);
 
        return 1;
 }