v160 · webtransport · getStats() · inspection
Member inventory: what the spec defines vs what you get
The spec's WebTransportConnectionStats has fourteen members and its datagrams dictionary four more — but "any unavailable stats will be absent", and a user agent exposes only the members it chooses. Chromium's own IDL declares just five connection members (no byte or packet totals, no atSendCapacity). On top of that, a pooled session may only report the members the spec marks as pooled connection stats. This tool runs a real getStats() and checks every member, one by one, with the in operator.
Availability. Chrome 160 ships WebTransport.prototype.getStats() enabled by default — the Blink runtime feature WebTransportStats is status: "stable" in runtime_enabled_features.json5. On an older Chrome the method is absent: enable chrome://flags/#enable-experimental-web-platform-features and relaunch, or launch with --enable-blink-features=WebTransportStats (both verified on Chrome 153). Real numbers also need a WebTransport server you can reach: this showcase has no HTTP/3 server of its own, so the default endpoint is a public echo server. If your network blocks QUIC the attempt fails with the real error, shown verbatim — never a made-up result. Running your own server is a few lines; see the local echo server recipe.
Inventory a live result
Pooling is a request, not a promise: Chrome may still give you a fresh connection. When the connection is shared, the spec removes every stat not marked "pooled" so one session cannot learn another's traffic volume.
| member | IDL type · unit | pooled stat? | in Chromium IDL? | this browser's result |
|---|
why members go missing
- Not implemented. Chromium's
web_transport_connection_stats.idldeclares onlysmoothedRtt,rttVariation,minRtt,datagramsandestimatedSendRate. The byte/packet counters andatSendCapacityexist in the spec but not in Chrome 160 — the ChromeStatus entry says so explicitly. - No sample yet. Chromium only sets the three RTT members once QUIC's
min_rttis positive, i.e. after the first RTT sample. Before that they are absent, not zero. - No estimate.
estimatedSendRateis always present (it defaults tonull) but isnullwhenever the congestion controller has no estimate. - Pooling. If
[[NewConnection]]is "no", the spec strips everything not marked as a pooled connection stat — notably the whole byte/packet family.
code path
const stats = await transport.getStats();
const want = ["bytesSent", "packetsLost", "smoothedRtt", "atSendCapacity"];
for (const name of want) {
console.log(name, name in stats ? stats[name] : "(not exposed)");
}
// datagrams is `required` — it is always there, but its members may not be:
"expiredIncoming" in stats.datagrams;