Skip to content

WebTransport stats support#3468

Open
jesup wants to merge 6 commits intousers/jesup/sendGroupfrom
users/jesup/stats
Open

WebTransport stats support#3468
jesup wants to merge 6 commits intousers/jesup/sendGroupfrom
users/jesup/stats

Conversation

@jesup
Copy link
Copy Markdown
Member

@jesup jesup commented Mar 16, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 16, 2026 04:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::Stats with 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_session API to return WebTransportSessionStats instead 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_session API to return WebTransportSessionStats instead of (), which is a breaking signature change for downstream callers. If the intent is additive, consider introducing a new method (or an alternate *_with_stats variant) 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,
        )
    }

Comment thread neqo-http3/tests/webtransport.rs Outdated
Comment thread neqo-transport/src/connection/mod.rs
Comment thread neqo-http3/src/features/extended_connect/webtransport_session.rs Outdated
@jesup jesup changed the title Users/jesup/stats WebTransport stats support Mar 16, 2026
Comment thread neqo-http3/src/features/extended_connect/stats.rs
Comment thread neqo-http3/src/features/extended_connect/webtransport_session.rs Outdated
Comment thread neqo-transport/src/stats.rs
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to merge these, can you add some basic tests?

Comment thread neqo-transport/src/stats.rs Outdated
@larseggert larseggert added the needs-rebase PR needs rebasing before it can be merged. label Apr 8, 2026
@jesup jesup force-pushed the users/jesup/sendGroup branch 2 times, most recently from 9a89365 to d564de8 Compare April 29, 2026 20:49
@jesup
Copy link
Copy Markdown
Member Author

jesup commented Apr 30, 2026

@github-actions
Copy link
Copy Markdown
Contributor

Failed Interop Tests

None ❓

All results

Succeeded Interop Tests

QUIC Interop Runner, client vs. server

neqo-pr as client

None ❓

neqo-pr as server

None ❓

Unsupported Interop Tests

QUIC Interop Runner, client vs. server

neqo-pr as client

None ❓

neqo-pr as server

None ❓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase PR needs rebasing before it can be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants