From a33c026d7e904340ec51fb0642529f814f97a45d Mon Sep 17 00:00:00 2001 From: Fabien SAVY Date: Fri, 27 Feb 2026 15:02:09 +0100 Subject: [PATCH] add metric for spurious congestion events --- quinn-proto/src/connection/mod.rs | 1 + quinn-proto/src/connection/stats.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/quinn-proto/src/connection/mod.rs b/quinn-proto/src/connection/mod.rs index 958311339d..845e81b6ab 100644 --- a/quinn-proto/src/connection/mod.rs +++ b/quinn-proto/src/connection/mod.rs @@ -1456,6 +1456,7 @@ impl Connection { }; if self.detect_spurious_loss(&ack, space) { + self.stats.path.spurious_congestion_events += 1; self.path.congestion.on_spurious_congestion_event(); } diff --git a/quinn-proto/src/connection/stats.rs b/quinn-proto/src/connection/stats.rs index f62e62ee6c..94779d0143 100644 --- a/quinn-proto/src/connection/stats.rs +++ b/quinn-proto/src/connection/stats.rs @@ -140,6 +140,8 @@ pub struct PathStats { pub cwnd: u64, /// Congestion events on the connection pub congestion_events: u64, + /// Spurious congestion events on the connection + pub spurious_congestion_events: u64, /// The amount of packets lost on this path pub lost_packets: u64, /// The amount of bytes lost on this path