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.
This commit is contained in:
Christopher Faulet 2021-11-26 17:37:07 +01:00
parent 6580f2868e
commit b4c584eed1
1 changed files with 32 additions and 0 deletions

View File

@ -25,6 +25,7 @@
#include <haproxy/pipe-t.h>
#include <haproxy/proxy.h>
#include <haproxy/session-t.h>
#include <haproxy/stats.h>
#include <haproxy/stream.h>
#include <haproxy/stream_interface.h>
#include <haproxy/trace.h>
@ -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));