]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: display stream age
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 9 May 2025 15:30:27 +0000 (17:30 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 13 May 2025 13:44:22 +0000 (15:44 +0200)
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.

include/haproxy/quic_stream-t.h
src/quic_cli.c
src/quic_stream.c

index acba309143cd56e71bce820cbbbf35dcf84720e1..a9738d2e900ddc642a969e0a1001a9bb7c5352a9 100644 (file)
@@ -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 */
 
index 4ba089a2ffe7e8fae8e560f65a9b4c098b5146c2..e3a41e61e9bc3d5d832c738c026eb028663c36b1 100644 (file)
@@ -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) {
index e2991324544863944b7d0d1a6ef2dcc4a6f1029f..b1b2e702337b51a079ad23af365ddf854ff4ccba 100644 (file)
@@ -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;