]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: add a new metric for ncbuf failures quic-interop flx04/quic-interop
authorMaxime Henrion <mhenrion@haproxy.com>
Mon, 23 Feb 2026 16:25:53 +0000 (11:25 -0500)
committerWilly Tarreau <w@1wt.eu>
Mon, 23 Feb 2026 16:47:45 +0000 (17:47 +0100)
This counts the number of times we failed to add data to the ncbuf
buffer because of the gap size limit.

include/haproxy/quic_stats-t.h
src/mux_quic.c
src/quic_stats.c

index 1ee626590b4fc16a856212a6fbd1c5b22fec7640..0a82d7cacbb3c9d536a4c29c1342c224b04ec899 100644 (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 */
index 14afb40737898b65b49b4eae43bf3a2ed0232812..8da5d9a2c080c5d9c1f8938f85f0ac13a20b68ae 100644 (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;
                }
 
index 9b6927f637a8ee682ac2533365b4e1c4a638e4f4..daee9456d01bbd2041695d6ea04eee55e9731dc8 100644 (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.