build a call-quality dashboard from WebRTC RTCPeerConnection.getStats() metrics
domain: w3.org · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Call pc.getStats() on an active RTCPeerConnection to retrieve an RTCStatsReport.
Iterate report entries and filter by type: inbound-rtp, outbound-rtp, remote-inbound-rtp, and candidate-pair.
From inbound-rtp, track packetsLost, jitter, and framesPerSecond; from outbound-rtp track bytesSent and retransmitted packets.
Compute derived rates (bitrate, packet-loss rate) between successive polls rather than using cumulative counters directly.
Poll on a roughly 1–10 second interval — sub-second polling adds overhead with little benefit, and multi-minute polling misses transient quality drops.
Known gotchas
Exact stat field names and available stat types have shifted across the spec's lifetime and browser implementations — feature-detect fields before reading them rather than assuming a fixed schema.
All stats fields are cumulative counters, not deltas, so graphing raw values instead of diffs between polls produces meaningless ever-increasing lines.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?