]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: pattern: add a counter of added/freed patterns
authorWilly Tarreau <w@1wt.eu>
Fri, 4 Jul 2025 22:07:25 +0000 (00:07 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 4 Jul 2025 22:12:45 +0000 (00:12 +0200)
commit573143e0c8792a073433830159bc869e2934d7ba
treecc1aca3c1b986807c6af0a0d732982e9ff32e7b6
parenta075d6928a5aa20d362a60b093b1e43b08655979
MINOR: pattern: add a counter of added/freed patterns

Patterns are allocated when loading maps/acls from a file or dynamically
via the CLI, and are released only from the CLI (e.g. "clear map xxx").
These ones do not use pools and are much harder to monitor, e.g. in case
a script adds many and forgets to clear them, etc.

Let's add a new pair of metrics "PatternsAdded" and "PatternsFreed" that
will report the number of added and freed patterns respectively. This
can allow to simply graph both. The difference between the two normally
represents the number of allocated patterns. If Added grows without
Freed following, it can indicate a faulty script that doesn't perform
the needed cleanup. The metrics are also made available to Prometheus
as patterns_added_total and patterns_freed_total respectively.
include/haproxy/pattern.h
include/haproxy/stats-t.h
src/pattern.c
src/stats.c