MINOR: h3: Add a statistics module for h3

Add ->inc_err_cnt new callback to qcc_app_ops struct which can
be called from xprt to increment the application level error code counters.
It take the application context as first parameter to be generic and support
new QUIC applications to come.
Add h3_stats.c module with counters for all the frame types and error codes.
This commit is contained in:
Frédéric Lécaille
2022-05-25 22:25:37 +02:00
committed by Amaury Denoyelle
parent 38dea05ca9
commit 6f7607ef1f
7 changed files with 335 additions and 8 deletions

View File

@@ -0,0 +1,12 @@
#ifndef _HAPROXY_H3_STATS_T_H
#define _HAPROXY_H3_STATS_T_H
#ifdef USE_QUIC
#ifndef USE_OPENSSL
#error "Must define USE_OPENSSL"
#endif
extern struct stats_module h3_stats_module;
#endif /* USE_QUIC */
#endif /* _HAPROXY_H3_STATS_T_H */

View File

@@ -0,0 +1,17 @@
#ifndef _HAPROXY_H3_STATS_H
#define _HAPROXY_H3_STATS_H
#ifdef USE_QUIC
#ifndef USE_OPENSSL
#error "Must define USE_OPENSSL"
#endif
#include <haproxy/h3_stats-t.h>
struct h3_counters;
void h3_inc_err_cnt(void *ctx, int error_code);
void h3_inc_frame_type_cnt(struct h3_counters *ctrs, int frm_type);
#endif /* USE_QUIC */
#endif /* _HAPROXY_H3_STATS_H */

View File

@@ -143,6 +143,7 @@ struct qcc_app_ops {
int (*finalize)(void *ctx);
int (*is_active)(const struct qcc *qcc, void *ctx);
void (*release)(void *ctx);
void (*inc_err_cnt)(void *ctx, int err_code);
};
#endif /* USE_QUIC */