WebTransport stats support#3468
Open
jesup wants to merge 6 commits intousers/jesup/sendGroupfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds richer transport-level byte/RTT/congestion statistics to neqo-transport and introduces WebTransport session-level statistics plumbing + APIs in neqo-http3, along with new tests to exercise the new fields.
Changes:
- Extend
neqo-transport::Statswith byte counters (bytes_tx/rx/lost/acked) and additional path metrics (min_rtt,cwnd,bytes_in_flight), and populate these from connection/recovery paths. - Add WebTransport session statistics (
WebTransportSessionStats) with recording hooks for datagrams/bytes/streams, expose a client API to read stats, and return stats on session close. - Add/expand HTTP/3 tests for WebTransport session stats and transport stats.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| neqo-transport/src/stats.rs | Adds new transport stats fields and prints them in Debug output (plus updates the debug snapshot test). |
| neqo-transport/src/sender.rs | Exposes bytes_in_flight() from congestion controller for stats reporting. |
| neqo-transport/src/recovery/mod.rs | Accumulates bytes_lost when packets are declared lost. |
| neqo-transport/src/connection/mod.rs | Records bytes TX/RX/ACKed and snapshots min_rtt, cwnd, bytes_in_flight. |
| neqo-http3/src/features/extended_connect/stats.rs | Introduces WebTransportSessionStats struct. |
| neqo-http3/src/features/extended_connect/webtransport_session.rs | Stores and updates per-session WebTransport stats and exposes them via the protocol trait. |
| neqo-http3/src/features/extended_connect/session.rs | Records datagram send/recv bytes and counts; adds session stats accessor; makes datagram() mutable to record stats. |
| neqo-http3/src/connection.rs | Returns session stats on webtransport_close_session and adds internal stats accessor. |
| neqo-http3/src/connection_client.rs | Changes close-session return type to stats and adds a public webtransport_session_stats() API. |
| neqo-http3/src/connection_server.rs | Changes close-session return type to stats. |
| neqo-http3/src/server_events.rs | Adapts request close API by discarding returned stats. |
| neqo-http3/tests/webtransport.rs | Adds new integration tests covering session stats and the new transport stats fields. |
| neqo-http3/src/features/extended_connect/tests/webtransport/sessions.rs | Adds unit tests for initial/session stats evolution. |
| neqo-http3/src/features/extended_connect/mod.rs | Exports the new stats module. |
Comments suppressed due to low confidence (2)
neqo-http3/src/connection_server.rs:217
- This changes the public
webtransport_close_sessionAPI to returnWebTransportSessionStatsinstead of(), which is a breaking signature change for downstream callers. If compatibility matters, consider adding a new API that returns stats while keeping the existing signature, and update the rustdoc to describe the return value.
pub fn webtransport_close_session(
&mut self,
conn: &mut Connection,
session_id: StreamId,
error: u32,
message: &str,
now: Instant,
) -> Res<crate::features::extended_connect::stats::WebTransportSessionStats> {
self.needs_processing = true;
self.base_handler
.webtransport_close_session(conn, session_id, error, message, now)
}
neqo-http3/src/connection_client.rs:781
- This changes the public
webtransport_close_sessionAPI to returnWebTransportSessionStatsinstead of(), which is a breaking signature change for downstream callers. If the intent is additive, consider introducing a new method (or an alternate*_with_statsvariant) and keeping the existing signature, or ensure the docs clearly describe the returned stats and that any semver/compat expectations are addressed.
pub fn webtransport_close_session(
&mut self,
session_id: StreamId,
error: u32,
message: &str,
now: Instant,
) -> Res<crate::features::extended_connect::stats::WebTransportSessionStats> {
self.base_handler.webtransport_close_session(
&mut self.conn,
session_id,
error,
message,
now,
)
}
mxinden
reviewed
Mar 16, 2026
Member
There was a problem hiding this comment.
If we want to merge these, can you add some basic tests?
9a89365 to
d564de8
Compare
d564de8 to
f5b9bdc
Compare
5a6b2bd to
adce244
Compare
This was referenced Apr 30, 2026
Member
Author
|
This PR is part of a stack of 13 bookmarks:
Created with jj-stack |
Contributor
Failed Interop TestsNone ❓ All resultsSucceeded Interop TestsQUIC Interop Runner, client vs. server neqo-pr as clientNone ❓ neqo-pr as serverNone ❓ Unsupported Interop TestsQUIC Interop Runner, client vs. server neqo-pr as clientNone ❓ neqo-pr as serverNone ❓ |
This was referenced Apr 30, 2026
This was referenced May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.