From: Amaury Denoyelle Date: Fri, 9 May 2025 15:30:27 +0000 (+0200) Subject: MINOR: quic: display stream age X-Git-Tag: v3.2-dev16~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f3b9676416662b57d3b6fc1a084ef297efd693f3;p=thirdparty%2Fhaproxy.git MINOR: quic: display stream age Add a field to save the creation date of qc_stream_desc instance. This is useful to display QUIC stream age in "show quic stream" output. --- diff --git a/include/haproxy/quic_stream-t.h b/include/haproxy/quic_stream-t.h index acba30914..a9738d2e9 100644 --- a/include/haproxy/quic_stream-t.h +++ b/include/haproxy/quic_stream-t.h @@ -45,6 +45,7 @@ struct qc_stream_desc { uint64_t ack_offset; /* last acknowledged offset */ struct eb_root buf_tree; /* list of active and released buffers */ struct bdata_ctr data; /* data utilization counter */ + ullong origin_ts; /* timestamp for creation date of current stream instance */ int flags; /* QC_SD_FL_* values */ diff --git a/src/quic_cli.c b/src/quic_cli.c index 4ba089a2f..e3a41e61e 100644 --- a/src/quic_cli.c +++ b/src/quic_cli.c @@ -245,7 +245,8 @@ static void dump_quic_stream(struct show_quic_ctx *ctx, struct quic_conn *qc) continue; } - chunk_appendf(&trash, "%p.%04llu: 0x%02x", qc, (ullong)id, sd->flags); + chunk_appendf(&trash, "%p.%04llu: 0x%02x age=%s", qc, (ullong)id, sd->flags, + human_time(ns_to_sec(now_ns) - ns_to_sec(sd->origin_ts), 1)); bdata_ctr_print(&trash, &sd->data, "tx=["); if (qcs) { diff --git a/src/quic_stream.c b/src/quic_stream.c index e29913245..b1b2e7023 100644 --- a/src/quic_stream.c +++ b/src/quic_stream.c @@ -89,6 +89,7 @@ struct qc_stream_desc *qc_stream_desc_new(uint64_t id, enum qcs_type type, void stream->buf_offset = 0; bdata_ctr_init(&stream->data); + stream->origin_ts = now_ns; stream->ack_offset = 0; stream->flags = 0; stream->ctx = ctx;