mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-03-14 03:22:06 +01:00
MINOR: counters: add EXTRA_COUNTERS_BASE() to retrieve extra_counters base storage
The goal is to always retrieve the storage address of the first thread group for the given module. This will be used to iterate over all thread groups. For now it returns the same value as EXTRA_COUNTERS_GET().
This commit is contained in:
parent
a60e1fcf7f
commit
de0eddf512
@ -104,6 +104,12 @@ void counters_be_shared_drop(struct be_counters_shared *counters);
|
||||
})
|
||||
|
||||
/* Manipulation of extra_counters, for boot-time registrable modules */
|
||||
/* retrieve the base storage of extra counters (first tgroup if any) */
|
||||
#define EXTRA_COUNTERS_BASE(counters, mod) \
|
||||
(likely(counters) ? \
|
||||
((void *)(*(counters)->datap + (mod)->counters_off[(counters)->type])) : \
|
||||
(trash_counters))
|
||||
|
||||
#define EXTRA_COUNTERS_GET(counters, mod) \
|
||||
(likely(counters) ? \
|
||||
((void *)(*(counters)->datap + (mod)->counters_off[(counters)->type])) : \
|
||||
|
||||
@ -141,7 +141,7 @@ static int h3_fill_stats(struct stats_module *mod, struct extra_counters *ctr,
|
||||
if (!ctr)
|
||||
goto store_metric;
|
||||
|
||||
counters = EXTRA_COUNTERS_GET(ctr, mod);
|
||||
counters = EXTRA_COUNTERS_BASE(ctr, mod);
|
||||
|
||||
switch (current_field) {
|
||||
/* h3 frame type counters */
|
||||
|
||||
@ -284,7 +284,7 @@ static int h1_fill_stats(struct stats_module *mod, struct extra_counters *ctr,
|
||||
if (!ctr)
|
||||
goto store_metric;
|
||||
|
||||
counters = EXTRA_COUNTERS_GET(ctr, mod);
|
||||
counters = EXTRA_COUNTERS_BASE(ctr, mod);
|
||||
|
||||
switch (current_field) {
|
||||
case H1_ST_OPEN_CONN:
|
||||
|
||||
@ -383,7 +383,7 @@ static int h2_fill_stats(struct stats_module *mod, struct extra_counters *ctr,
|
||||
if (!ctr)
|
||||
goto store_metric;
|
||||
|
||||
counters = EXTRA_COUNTERS_GET(ctr, mod);
|
||||
counters = EXTRA_COUNTERS_BASE(ctr, mod);
|
||||
|
||||
switch (current_field) {
|
||||
case H2_ST_HEADERS_RCVD:
|
||||
|
||||
@ -104,7 +104,7 @@ static int quic_fill_stats(struct stats_module *mod, struct extra_counters *ctr,
|
||||
if (!ctr)
|
||||
goto store_metric;
|
||||
|
||||
counters = EXTRA_COUNTERS_GET(ctr, mod);
|
||||
counters = EXTRA_COUNTERS_BASE(ctr, mod);
|
||||
|
||||
switch (current_field) {
|
||||
case QUIC_ST_RXBUF_FULL:
|
||||
|
||||
@ -134,7 +134,7 @@ static int resolv_fill_stats(struct stats_module *mod, struct extra_counters *ct
|
||||
if (!ctr)
|
||||
goto store_metric;
|
||||
|
||||
counters = EXTRA_COUNTERS_GET(ctr, mod);
|
||||
counters = EXTRA_COUNTERS_BASE(ctr, mod);
|
||||
|
||||
switch (current_field) {
|
||||
case RSLV_STAT_ID:
|
||||
|
||||
@ -206,7 +206,7 @@ static int ssl_fill_stats(struct stats_module *mod, struct extra_counters *ctr,
|
||||
if (!ctr)
|
||||
goto store_metric;
|
||||
|
||||
counters = EXTRA_COUNTERS_GET(ctr, mod);
|
||||
counters = EXTRA_COUNTERS_BASE(ctr, mod);
|
||||
|
||||
switch (current_field) {
|
||||
case SSL_ST_SESS:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user