Skip to content

transport: expose per-connection ConnectionStats (part of #40) - #77

Merged
ch4r10t33r merged 1 commit into
mainfrom
feat/connection-stats-40
Jul 5, 2026
Merged

transport: expose per-connection ConnectionStats (part of #40)#77
ch4r10t33r merged 1 commit into
mainfrom
feat/connection-stats-40

Conversation

@ch4r10t33r

Copy link
Copy Markdown
Collaborator

Part of #40 (transport features present in the Go reference).

The Go sim/ transport implements Conn.ConnectionStats() (bytesSent, bytesReceived) (transport/quic/quic.go). zquic already tracks these per connection and exposes them via io.ConnState.snapshotStats() — this just surfaces them:

  • zquic_quic_shim.QuicConnection.connectionStats() ?ConnStats → reads snapshotStats(), returns { bytes_sent, bytes_received }.
  • eth_ec_quic_peer.PeerConn.connectionStats() ?quic.ConnStats → the public accessor.

The QUIC listen + dial, TLS handshake test now asserts a completed handshake reports non-zero bytes_sent and bytes_received.

No zquic dependency change (the underlying stats API is already public). zig build test + zig build test-quic pass on stock 0.16.0.

Remaining #40 items (stream Reset/CancelRead/CancelWrite, datagrams, deadlines) are separate; the stream-reset piece needs a new public zquic API and will follow.

Surfaces zquic's per-connection byte counters through the shim, mirroring
the Go transport `Conn.ConnectionStats()` (`transport/quic/quic.go`).

`zquic_quic_shim.QuicConnection.connectionStats()` reads the underlying
`io.ConnState.snapshotStats()` and returns `{ bytes_sent, bytes_received }`;
`eth_ec_quic_peer.PeerConn.connectionStats()` exposes it to callers. The QUIC
handshake test now asserts a completed handshake reports non-zero bytes in
both directions.

No zquic change needed — `snapshotStats` is already public. Refs #40.
@ch4r10t33r
ch4r10t33r merged commit df4eb54 into main Jul 5, 2026
7 checks passed
@ch4r10t33r
ch4r10t33r deleted the feat/connection-stats-40 branch July 5, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant