Skip to content

Move WebTransport stats from SessionStats to session::Stats... #3666

Description

@jesup

See #3468 (comment)

Plan:

  1. Delete neqo-http3/src/features/extended_connect/stats.rs

  2. Move the struct into session.rs — add it near the top of neqo-http3/src/features/extended_connect/session.rs, rename to Stats:

/// Per-session statistics exposed to the WebTransport API consumer.
#[derive(Debug, Clone, Default)]
pub struct Stats {
pub timestamp: Option,
pub bytes_sent: u64,
pub bytes_received: u64,
pub datagrams_sent: u64,
pub datagrams_received: u64,
pub streams_opened_local: u64,
pub streams_opened_remote: u64,
pub expired_outgoing: u64,
pub expired_incoming: u64,
pub lost_outgoing: u64,
pub dropped_incoming: u64,
}

No #[expect(module_name_repetitions)] needed — session::Stats doesn't repeat.

  1. Remove pub mod stats; from the extended_connect module declaration.

  2. Update imports (6 files):

  ┌────────────────────────────────┬────────────────────────────────────────────────────────┬───────────────────────────────────────────────────┐
  │              File              │                          Old                           │                        New                        │
  ├────────────────────────────────┼────────────────────────────────────────────────────────┼───────────────────────────────────────────────────┤
  │ webtransport_session.rs        │ stats::SessionStats                                    │ session::Stats                                    │
  ├────────────────────────────────┼────────────────────────────────────────────────────────┼───────────────────────────────────────────────────┤
  │ session.rs                     │ stats::SessionStats                                    │ (local, just Stats)                               │
  ├────────────────────────────────┼────────────────────────────────────────────────────────┼───────────────────────────────────────────────────┤
  │ connection.rs (2 sites)        │ extended_connect::stats::SessionStats                  │ extended_connect::session::Stats                  │
  ├────────────────────────────────┼────────────────────────────────────────────────────────┼───────────────────────────────────────────────────┤
  │ connection_server.rs           │ crate::features::extended_connect::stats::SessionStats │ crate::features::extended_connect::session::Stats │
  ├────────────────────────────────┼────────────────────────────────────────────────────────┼───────────────────────────────────────────────────┤
  │ connection_client.rs (2 sites) │ crate::features::extended_connect::stats::SessionStats │ crate::features::extended_connect::session::Stats │
  └────────────────────────────────┴────────────────────────────────────────────────────────┴───────────────────────────────────────────────────┘

  1. Later patches affected: tx (adds bytes_sent_overhead field + #[non_exhaustive]), km (uses SessionStats in datagram queue context), and anything that references the
    type. All would need their import paths updated from stats::SessionStats to session::Stats.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions