]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: counters: add a dedicated storage for extra_counters in various structs
authorWilly Tarreau <w@1wt.eu>
Tue, 24 Feb 2026 19:08:49 +0000 (20:08 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 26 Feb 2026 16:03:47 +0000 (17:03 +0100)
commit04a9f86a857940dddabf3f789bf6927c0f8307f4
treed0556b5b8269f325ae20cd8600576b405ea6872b
parent8dd22a62a43bf2476835a0c14c2f9f45d57c0e99
MEDIUM: counters: add a dedicated storage for extra_counters in various structs

Servers, proxies, listeners and resolvers all use extra_counters. We'll
need to move the storage to per-tgroup for those where it matters. Now
we're relying on an external storage, and the data member of the struct
was replaced with a pointer to that pointer to data called datap. When
the counters are registered, these datap are set to point to relevant
locations. In the case of proxies and servers, it points to the first
tgrp's storage. For listeners and resolvers, it points to a local
storage. The rationale here is that listeners are limited to a single
group anyway, and that resolvers have a low enough load so that we do
not care about contention there.

Nothing should change for the user at this point.
include/haproxy/counters-t.h
include/haproxy/counters.h
include/haproxy/dns-t.h
include/haproxy/listener-t.h
include/haproxy/proxy-t.h
include/haproxy/server-t.h
include/haproxy/stats.h
src/proxy.c
src/resolvers.c
src/server.c
src/stats.c