]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: stats: introduce a more expressive stat definition method
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 28 Mar 2024 13:53:39 +0000 (14:53 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 26 Apr 2024 08:20:57 +0000 (10:20 +0200)
commit65624876f2baab12afc7e3398b806d4c8412aa7b
treeb22c7087cdd6246a49d25e4543e2baccfcf5e10e
parent861370a6d42bc98596d08311b8308abcca1da4bc
MINOR: stats: introduce a more expressive stat definition method

Previously, statistics were simply defined as a list of name_desc, as
for example "stat_cols_px" for proxy stats. No notion of type was fixed
for each stat definition. This correspondance was done individually
inside stats_fill_*_line() functions. This renders the process to
define new statistics tedious.

Implement a more expressive stat definition method via a new API. A new
type "struct stat_col" for stat column to replace name_desc usage is
defined. It contains a field to store the stat nature and format. A
<cap> field is also defined to be able to define a proxy stat only for
certain type of objects.

This new type is also further extended to include counter offsets. This
allows to define a method to automatically generate a stat value field
from a "struct stat_col". This will be the subject of a future commit.

New type "struct stat_col" is fully compatible full name_desc. This
allows to gradually convert stats definition. The focus will be first
for proxies counters to implement statistics preservation on reload.
include/haproxy/stats-t.h
include/haproxy/stats.h
src/h3_stats.c
src/mux_h1.c
src/mux_h2.c
src/quic_stats.c
src/resolvers.c
src/ssl_sock.c
src/stats.c