]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: stats: convert stats_dump_sv_stats() to use stats_dump_fields_csv()
authorWilly Tarreau <w@1wt.eu>
Wed, 6 Jan 2016 18:25:38 +0000 (19:25 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 11 Mar 2016 16:08:04 +0000 (17:08 +0100)
commit2b96cf1292a4f4dc559a8b2ecbc64a8621f4c700
tree08a48183ca028dcf1332b5a36c4d9acd570354b5
parent770c217bb1ff792387c79dd27083d724009e433c
MEDIUM: stats: convert stats_dump_sv_stats() to use stats_dump_fields_csv()

This function now only fills the relevant fields with raw values and
calls stats_dump_fields_csv() for the CSV part. The output remains
exactly the same for now.

Some limits are only emitted if set, so the HTML part will have to
check for these being set.

A number of fields had to be built using printf-format strings, so
instead of allocating strings that risk not being freed, we use
chunk_newstr() and chunk_appendf().

Text strings are now copied verbatim in the stats fields so that only
the CSV dump encodes them as CSV. A single "out" chunk is used and cut
into multiple substrings using chunk_newstr() so that we don't need
distinct chunks for each stats field holding a string. The total amount
of data being emitted at once will never overflow the "out" chunk since
only a small part of it goes into the trash buffer which is the same size
and will thus overflow first.

One point of care is that failed_checks and down_trans were logged as
64-bit quantities on servers but they're 32-bit on proxies. This may
have to be changed later to unify them.
src/dumpstats.c