]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: stats: prepare stats-file support for values other than FN_COUNTER
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 29 Apr 2024 15:06:27 +0000 (17:06 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 2 May 2024 08:55:25 +0000 (10:55 +0200)
commit4e9e841878d9bc09d171376cfcae2e9da671de4a
tree0eaf7f0ecabc84b6606b774dcca1bf3beb73e03d
parent933b4ae27d447cf7e450da03512299a94964cef8
MINOR: stats: prepare stats-file support for values other than FN_COUNTER

Currently, only FN_COUNTER are dumped and preloaded via a stats-file.
Thus in several places we relied on the assumption that only FN_COUNTER
are valid in stats-file context.

New stats types will soon be implemented as they are also eligilible to
statistics reloading on process startup. Thus, prepare stats-file
functions to remove any FN_COUNTER restriction.

As one of this change, generate_stat_tree() now uses stcol_is_generic()
for stats name tree indexing before stats-file parsing.

Also related to stats-file parsing, individual counter preloading step
as been extracted from line parsing in a dedicated new function
load_ctr(). This will allow to extend it to support multiple mechanism
of counter preloading depending on the stats type.
include/haproxy/stats.h
src/stats-file.c
src/stats.c