]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: stats: properly handle ST_F_CHECK_DURATION metric
authorAurelien DARRAGON <adarragon@haproxy.com>
Wed, 7 Dec 2022 13:52:10 +0000 (14:52 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 7 Dec 2022 16:04:22 +0000 (17:04 +0100)
commitb118f2f407a824b44e787aae360fabd0172dbf0e
tree707589e3a8c2b90aa76648333d1a66518b0bf9cd
parent81b7c9518c593f511741115fe575a8529e6f7c67
MINOR: stats: properly handle ST_F_CHECK_DURATION metric

ST_F_CHECK_DURATION metric is typed as unsigned int variable, and it is
derived from check->duration that is signed.

While most of the time check->duration > 0, it is not always true:
with HCHK_STATUS_HANA checks, check->duration is set to -1 to prevent server
logs from including irrelevant duration info (HCHK_STATUS_HANA checks are not
time related).

Because of this, stats could report UINT64_MAX value for ST_F_CHECK_DURATION
metric. This was quite confusing. To prevent this, we make sure not to assign
negative value to ST_F_CHECK_DURATION.

This is only a minor printing issue, not backport needed.
src/stats.c