From b4c584eed17a2af4d0a256f810d3a38e69154ea4 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 26 Nov 2021 17:37:07 +0100 Subject: [PATCH] MINOR: mux-h1: register a stats module Use statistics API to register a new stats module generating counters on h1 module. The counters are attached to frontend/backend instances. --- src/mux_h1.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/mux_h1.c b/src/mux_h1.c index 3d5a24f165..f875b96092 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -261,6 +262,37 @@ static struct trace_source trace_h1 __read_mostly = { #define TRACE_SOURCE &trace_h1 INITCALL1(STG_REGISTER, trace_register_source, TRACE_SOURCE); + +/* h1 stats module */ +enum { + H1_STATS_COUNT /* must be the last member of the enum */ +}; + + +static struct name_desc h1_stats[] = { +}; + +static struct h1_counters { +} h1_counters; + +static void h1_fill_stats(void *data, struct field *stats) +{ +} + +static struct stats_module h1_stats_module = { + .name = "h1", + .fill_stats = h1_fill_stats, + .stats = h1_stats, + .stats_count = H1_STATS_COUNT, + .counters = &h1_counters, + .counters_size = sizeof(h1_counters), + .domain_flags = MK_STATS_PROXY_DOMAIN(STATS_PX_CAP_FE|STATS_PX_CAP_BE), + .clearable = 1, +}; + +INITCALL1(STG_REGISTER, stats_register_module, &h1_stats_module); + + /* the h1c and h1s pools */ DECLARE_STATIC_POOL(pool_head_h1c, "h1c", sizeof(struct h1c)); DECLARE_STATIC_POOL(pool_head_h1s, "h1s", sizeof(struct h1s));