]> git.ipfire.org Git - thirdparty/haproxy.git/commit
DEBUG: counters: add the ability to enable/disable updating the COUNT_IF counters
authorWilly Tarreau <w@1wt.eu>
Mon, 14 Apr 2025 16:31:25 +0000 (18:31 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 14 Apr 2025 17:02:13 +0000 (19:02 +0200)
commitb708345c1731dd6057e2e55e8c3943706c3e5ee4
treed4f105d98157787cb3b6c294c2b7638342b55b20
parenta142adaba017cfedd498f715a9b9c4d73137fefa
DEBUG: counters: add the ability to enable/disable updating the COUNT_IF counters

These counters can have a noticeable cost on large machines, though not
dramatic. There's no single good choice to keep them enabled or disabled.
This commit adds multiple choices:
  - DEBUG_COUNTERS set to 2 will automatically enable them by default, while
    1 will disable them by default
  - the global "debug.counters on/off" will allow to change the setting at
    boot, regardless of DEBUG_COUNTERS as long as it was at least 1.
  - the CLI "debug counters on/off" will also allow to change the value at
    run time, allowing to observe a phenomenon while it's happening, or to
    disable counters if it's suspected that their cost is too high

Finally, the "debug counters" command will append "(stopped)" at the end
of the CNT lines when these counters are stopped.

Not that the whole mechanism would easily support being extended to all
counter types by specifying the types to apply to, but it doesn't seem
useful at all and would require the user to also type "cnt" on debug
lines. This may easily be changed in the future if it's found relevant.
Makefile
doc/configuration.txt
doc/management.txt
include/haproxy/bug.h
src/debug.c