WebRTC Metrics

A comprehensive overview of WebRTC statistics, derived calculations, extracted features, and observable signals, to better understand call quality, connectivity, and user experience in rtcStats

Back
clientwebsocketuploadlatency

WebSocket connection time (feature)

Client-level feature recording how long the rtcstats-js upload websocket took to connect.

Description

Client-level feature, extracted per session into features_client.

webSocketConnectionTime records, in milliseconds, how long the rtcstats-js upload websocket took to connect. This is the channel rtcstats-js uses to stream trace data out of the client, so the field measures the health of the collection path itself rather than the WebRTC call.

Why it matters

Every other feature in your database depends on this websocket connecting. If it is slow or failing for a slice of your users, you are not just adding latency, you are losing observability: those sessions upload late or not at all, and your data quietly skews toward the users on good networks. Watching webSocketConnectionTime tells you whether the pipe that feeds everything else is healthy. A rising tail points at a network, TLS, or endpoint problem on the ingest side, often a regional one, and it is worth catching before you start trusting aggregate numbers that a chunk of your fleet never made it into.

SQL example

Median and 95th-percentile connection time, last 7 days:

SELECT
  PERCENTILE_CONT(0.5)  WITHIN GROUP (ORDER BY client.web_socket_connection_time) AS p50_ms,
  PERCENTILE_CONT(0.95) WITHIN GROUP (ORDER BY client.web_socket_connection_time) AS p95_ms
FROM "rtcstats-server" AS server
JOIN features_metadata AS metadata ON metadata.dump_id = server.id
JOIN features_client   AS client   ON client.dump_id   = metadata.id
WHERE server.created_at > NOW() - INTERVAL '7 days'
  AND client.web_socket_connection_time IS NOT NULL;

See also