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.
This commit is contained in:
Amaury Denoyelle 2025-05-09 17:30:27 +02:00
parent dbf07c754e
commit f3b9676416
3 changed files with 4 additions and 1 deletions

View 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 */

View 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) {

View 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;