[webrtc-stats] Stats objects creation and WebRTC objects lifecycle (#539)

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

== Stats objects creation and WebRTC objects lifecycle ==
The spec is not particularly explicit as to when a given stats starts being reported. There is a mention of "created" for `MediaSourceStats` and `RTCRtpTransceiverStats`, but none of the other objects.

I think (but haven't been able to confirm for sure) that the variation across test results for MTI stats both across browsers and within a given browser are likely bound to this. In particular, the MTI test that waits for 20s reports lots more available stats than the other tests (even once manually removed the fields that are indeed not implemented in the said browser):
* https://wpt.fyi/results/webrtc/RTCPeerConnection-mandatory-getStats.https.html
* https://wpt.fyi/results/webrtc/RTCRtpReceiver-getStats.https.html
* https://wpt.fyi/results/webrtc/RTCRtpSender-getStats.https.html
* https://wpt.fyi/results/webrtc/getstats.html
* https://wpt.fyi/results/webrtc/RTCPeerConnection-getStats.https.html

Ideally, the main WebRTC spec would either provide a spec hook for stats creation, or would explicitly say when a given stats start being available.

I'm not sure if some fields for a given stat objects only start being set after some defined event; but if so, this should probably be made more explicit or being integrated more tightly in the WebRTC objects lifecycle.

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

Received on Monday, 3 February 2020 13:27:42 UTC