]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: stats: protect against future stats fields omissions
authorWilly Tarreau <w@1wt.eu>
Fri, 2 Jun 2023 06:35:50 +0000 (08:35 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 2 Jun 2023 06:39:53 +0000 (08:39 +0200)
commitae0f8be0111b8ea128c6e35ee22451162eb98818
tree6b197fa73be643b2fbffc19d89e7a7698c8f5f72
parent33a4461fa9a0a57f33a0c34055c1592cf70fca38
MINOR: stats: protect against future stats fields omissions

As seen in commits 33a4461fa ("BUG/MINOR: stats: Fix Lua's `get_stats`
function") and a46b142e8 ("BUG/MINOR: Missing stat_field_names (since
f21d17bb)") it seems frequent to omit to update stats_fields[] when
adding a new ST_F_xxx entry. This breaks Lua's get_stats() and shows
a "(null)" in the header of "show stat", but that one is not detectable
to the naked eye anymore.

Let's add a reminder above the enum declaration about this, and a small
reg tests checking for the absence of "(null)". It was verified to fail
before the last patch above.
include/haproxy/stats-t.h
reg-tests/webstats/missing-stats-fields.vtc [new file with mode: 0644]