tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 2661076a13cbc70e34f4886c840f9664f5891f61
parent b2bada9642675e69b7b8c4dca8d1c472c9d73696
Author: Oskar Mansfeld <git@omansfeld.net>
Date:   Mon,  5 Jan 2026 17:39:22 +0000

Bug 2004031 - Add labeled counter for congestion event reason. r=mxinden

Counting how many events are triggered by loss vs. ecn-ce marking.

Differential Revision: https://phabricator.services.mozilla.com/D275452

Diffstat:
Mnetwerk/metrics.yaml | 18++++++++++++++++++
Mnetwerk/socket/neqo_glue/src/lib.rs | 20++++++++++++++++++++
2 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/netwerk/metrics.yaml b/netwerk/metrics.yaml @@ -1131,6 +1131,24 @@ networking: - exited - not_exited + http_3_congestion_event_reason: + type: labeled_counter + description: > + The type of signal that caused a congestion event in Firefox's QUIC stack. + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=2004031 + data_reviews: + - https://bugzilla.mozilla.org/show_bug.cgi?id=2004031 + data_sensitivity: + - technical + notification_emails: + - necko@mozilla.com + - omansfeld@mozilla.com + expires: 157 + labels: + - loss + - ecn-ce + http_3_connection_close_reason: type: labeled_counter description: > diff --git a/netwerk/socket/neqo_glue/src/lib.rs b/netwerk/socket/neqo_glue/src/lib.rs @@ -707,6 +707,26 @@ impl NeqoHttp3Conn { debug_assert!(false, "{msg}"); } } + + // Collect congestion event reason metric + if let Ok(ce_loss) = i32::try_from(stats.cc.congestion_events[CongestionEvent::Loss]) { + glean::http_3_congestion_event_reason + .get("loss") + .add(ce_loss); + } else { + let msg = "Failed to convert to i32 for use with glean"; + qwarn!("{msg}"); + debug_assert!(false, "{msg}"); + } + if let Ok(ce_ecn) = i32::try_from(stats.cc.congestion_events[CongestionEvent::Ecn]) { + glean::http_3_congestion_event_reason + .get("ecn-ce") + .add(ce_ecn); + } else { + let msg = "Failed to convert to i32 for use with glean"; + qwarn!("{msg}"); + debug_assert!(false, "{msg}"); + } } fn increment_would_block_rx(&mut self) {