]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: stats: parse header lines from stats-file
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 24 Apr 2024 09:14:48 +0000 (11:14 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 26 Apr 2024 09:34:02 +0000 (11:34 +0200)
commit374dc08611089471116d4512d16522ccf696bb92
tree9c3f90965fad02c2071d62dfae389b690a46b7a3
parent34ae7755b36c3d23ed529d2fea2da2084fe2d41e
MINOR: stats: parse header lines from stats-file

This patch implements parsing of headers line from stats-file.

A header line is defined as starting with '#' character. It is directly
followed by a domain name. For the moment, either 'fe' or 'be' is
allowed. The following lines will contain counters values relatives to
the domain context until the next header line.

This is implemented via static function parse_header_line(). It first
sets the domain context used during apply_stats_file(). A stats column
array is generated to contains the order on which column are stored.
This will be reused to parse following lines values.

If an invalid line is found and no header was parsed, considered the
stats-file as ill formatted and stop parsing. This allows to immediately
interrupt parsing if a garbage file was used without emitting a ton of
warnings to the user.
include/haproxy/stats-file-t.h [new file with mode: 0644]
include/haproxy/stats-file.h
src/stats-file.c