]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: stats: implement automatic metric generation from stat_col
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 11 Apr 2024 11:56:19 +0000 (13:56 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 26 Apr 2024 08:20:57 +0000 (10:20 +0200)
commita7810b7be66565da508867250bb5cf6f2790d8c2
tree8a6692a00d98735deae59ecea4526cea26ce7d9c
parent65624876f2baab12afc7e3398b806d4c8412aa7b
MINOR: stats: implement automatic metric generation from stat_col

This commit is a direct follow-up of the previous one which define a new
type "struct stat_col" to fully define a statistic entry.

Define a new function metric_generate(). For metrics statistics, it is
able to automatically calculate a stat value field for "offsets" from
"struct stat_col". Use it in stats_fill_*_stats() functions. Maintain a
fallback to previously used switch-case for old-style statistics.

This commit does not introduce functional change as currently no
statistic is defined as "struct stat_col". This will be the subject of a
future commit.
include/haproxy/stats.h
src/stats.c