MINOR: quic: Add some counters at QUIC connection level

Add some statistical counters to quic_conn struct from quic_counters struct which
are used at listener level to handle them at QUIC connection level. This avoid
calling atomic functions. Furthermore this will be useful soon when a counter will
be added for the total number of packets which have been sent which will be very
often incremented.

Some counters were not added, espcially those which count the number of QUIC errors
by QUIC error types. Indeed such counters would be incremented most of the time
only one time at QUIC connection level.

Implement quic_conn_prx_cntrs_update() which accumulates the QUIC connection level
statistical counters to the listener level statistical counters.

Must be backported to 2.7.
This commit is contained in:
Frdric Lcaille
2023-05-24 11:10:19 +02:00
committed by Willy Tarreau
parent 464281af46
commit bdd64fd71d
4 changed files with 59 additions and 19 deletions

View File

@@ -600,6 +600,23 @@ enum qc_mux_state {
QC_MUX_RELEASED, /* released, data can be dropped */
};
/* Counters at QUIC connection level */
struct quic_conn_cntrs {
long long dropped_pkt; /* total number of dropped packets */
long long dropped_pkt_bufoverrun;/* total number of dropped packets because of buffer overrun */
long long dropped_parsing; /* total number of dropped packets upon parsing errors */
long long socket_full; /* total number of EAGAIN errors on sendto() calls */
long long sendto_err; /* total number of errors on sendto() calls, EAGAIN excepted */
long long sendto_err_unknown; /* total number of errors on sendto() calls which are currently not supported */
long long lost_pkt; /* total number of lost packets */
long long conn_migration_done; /* total number of connection migration handled */
/* Streams related counters */
long long data_blocked; /* total number of times DATA_BLOCKED frame was received */
long long stream_data_blocked; /* total number of times STEAM_DATA_BLOCKED frame was received */
long long streams_data_blocked_bidi; /* total number of times STREAMS_DATA_BLOCKED_BIDI frame was received */
long long streams_data_blocked_uni; /* total number of times STREAMS_DATA_BLOCKED_UNI frame was received */
};
/* The number of buffers for outgoing packets (must be a power of two). */
#define QUIC_CONN_TX_BUFS_NB 8
@@ -728,6 +745,9 @@ struct quic_conn {
unsigned int nb_pkt_since_cc;
const struct qcc_app_ops *app_ops;
/* QUIC connection level counters */
struct quic_conn_cntrs cntrs;
/* Proxy counters */
struct quic_counters *prx_counters;
struct list el_th_ctx; /* list elem in ha_thread_ctx */