transport: expose per-connection ConnectionStats (part of #40) - #77
Merged
Conversation
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.
This was referenced Jul 5, 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.
Part of #40 (transport features present in the Go reference).
The Go
sim/transport implementsConn.ConnectionStats() (bytesSent, bytesReceived)(transport/quic/quic.go). zquic already tracks these per connection and exposes them viaio.ConnState.snapshotStats()— this just surfaces them:zquic_quic_shim.QuicConnection.connectionStats() ?ConnStats→ readssnapshotStats(), returns{ bytes_sent, bytes_received }.eth_ec_quic_peer.PeerConn.connectionStats() ?quic.ConnStats→ the public accessor.The
QUIC listen + dial, TLS handshaketest now asserts a completed handshake reports non-zerobytes_sentandbytes_received.No zquic dependency change (the underlying stats API is already public).
zig build test+zig build test-quicpass 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.