MINOR: quic: add a new metric for ncbuf failures
Some checks failed
Contrib / build (push) Has been cancelled
alpine/musl / gcc (push) Has been cancelled
VTest / Generate Build Matrix (push) Has been cancelled
Windows / Windows, gcc, all features (push) Has been cancelled
VTest / (push) Has been cancelled

This counts the number of times we failed to add data to the ncbuf
buffer because of the gap size limit.
This commit is contained in:
Maxime Henrion 2026-02-23 11:25:53 -05:00 committed by Willy Tarreau
parent 05d73aa81c
commit a9dc8e2587
3 changed files with 12 additions and 0 deletions

View file

@ -52,6 +52,7 @@ enum {
QUIC_ST_STREAM_DATA_BLOCKED,
QUIC_ST_STREAMS_BLOCKED_BIDI,
QUIC_ST_STREAMS_BLOCKED_UNI,
QUIC_ST_NCBUF_GAP_LIMIT,
QUIC_STATS_COUNT /* must be the last */
};
@ -99,6 +100,7 @@ struct quic_counters {
long long stream_data_blocked; /* total number of times STREAM_DATA_BLOCKED frame was received */
long long streams_blocked_bidi; /* total number of times STREAMS_BLOCKED_BIDI frame was received */
long long streams_blocked_uni; /* total number of times STREAMS_BLOCKED_UNI frame was received */
long long ncbuf_gap_limit; /* total number of times we failed to add data to ncbuf due to gap size limit */
};
#endif /* USE_QUIC */

View file

@ -1875,6 +1875,8 @@ int qcc_recv(struct qcc *qcc, uint64_t id, uint64_t len, uint64_t offset,
left = len;
while (left) {
struct qc_stream_rxbuf *buf;
struct proxy *px;
struct quic_counters *prx_counters;
ncb_sz_t ncb_off;
buf = qcs_get_rxbuf(qcs, offset, &len);
@ -1911,6 +1913,9 @@ int qcc_recv(struct qcc *qcc, uint64_t id, uint64_t len, uint64_t offset,
case NCB_RET_GAP_SIZE:
TRACE_DATA("cannot bufferize frame due to gap size limit", QMUX_EV_QCC_RECV|QMUX_EV_QCS_RECV,
qcc->conn, qcs);
px = qcc->proxy;
prx_counters = EXTRA_COUNTERS_GET(px->extra_counters_fe, &quic_stats_module);
HA_ATOMIC_INC(&prx_counters->ncbuf_gap_limit);
return 1;
}

View file

@ -86,6 +86,8 @@ static struct stat_col quic_stats[] = {
.desc = "Total number of received STREAMS_BLOCKED_BIDI frames" },
[QUIC_ST_STREAMS_BLOCKED_UNI] = { .name = "quic_streams_blocked_uni",
.desc = "Total number of received STREAMS_BLOCKED_UNI frames" },
[QUIC_ST_NCBUF_GAP_LIMIT] = { .name = "quic_ncbuf_gap_limit",
.desc = "Total number of failures to add to ncbuf because of gap size limit" },
};
struct quic_counters quic_counters;
@ -225,6 +227,9 @@ static int quic_fill_stats(void *data, struct field *stats, unsigned int *select
case QUIC_ST_STREAMS_BLOCKED_UNI:
metric = mkf_u64(FN_COUNTER, counters->streams_blocked_uni);
break;
case QUIC_ST_NCBUF_GAP_LIMIT:
metric = mkf_u64(FN_COUNTER, counters->ncbuf_gap_limit);
break;
default:
/* not used for frontends. If a specific metric
* is requested, return an error. Otherwise continue.