[webrtc-stats] Add stat for RTTs between client and STUN/TURN server

taylor-b has just created a new issue for https://github.com/w3c/webrtc-stats:

== Add stat for RTTs between client and STUN/TURN server ==
We already have `totalRoundTripTime` in `RTCIceCandidatePairStats`, and `roundTripTime` in `RTCRemoteInboundRtpStreamStats`, but these are both an end-to-end round trip time.

I suggest a similar stat to `RTCIceCandidateStats`, which would accumulate round trip times as measured by STUN transactions between client and STUN server (from initial candidate gathering, keepalives for NAT bindings, TURN refreshes, etc.). We've encountered a couple uses for this:

- It can provide some information about the endpoint's Internet connection even before connecting to a remote endpoint.
- Once connected, it can help indicate which side of the connection is contributing more to latency.

So I'd suggest adding something like:

- `totalStunRoundTripTime`
- `totalStunResponsesReceived` (divide by this to get average RTT)
- `totalStunRequestsSent` (allows you to detect packet loss)

Or maybe `totalStunServerRoundTripTime`, to make it extra clear that this is between the client and STUN server, and doesn't include connectivity checks.

Please view or discuss this issue at https://github.com/w3c/webrtc-stats/issues/339 using your GitHub account

Received on Wednesday, 7 March 2018 02:09:15 UTC