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

to give a few examples of tests results that potentially show the need for more clarity:
* when do `RTCPeerConnectionStats` entries appear? from the [WPT tests](https://wpt.fyi/results/webrtc/RTCPeerConnection-getStats.https.html?label=experimental&label=master&aligned), it looks like they only appear when data channels are set up in Firefox. I guess one could interpret the fact that `peer-connection` stats are "related to `RTCPeerConnection` objects" to mean that `RTCPeerConnection` is the monitored object, and thus the stat itself should be made available as soon as the object is created, but that latter rule isn't really made explicit anywhere that I could find, and the implementation discrepancy seems to show it deserves more clarity
* conversely, Firefox reports `outbound-rtp` stats as soon as `addTrack` is called, whereas Chrome seems to be doing so only if there is a peer on the other side. That one may already be explicit enough in the spec
> The lifetime of all RTP monitored objects starts when the RTP stream is first used: When the first RTP packet is sent or received on the SSRC it represents, or when the first RTCP packet is sent or received that refers to the SSRC of the RTP stream. 

(but then, if Chrome's interpretation is correct, the test ["getStats() with no argument should return stats report containing peer-connection stats and outbound-track-stats"](https://github.com/web-platform-tests/wpt/blob/master/webrtc/RTCPeerConnection-getStats.https.html) should be fixed to make too-early-stats reporting fail)


-- 
GitHub Notification of comment by dontcallmedom
Please view or discuss this issue at https://github.com/w3c/webrtc-stats/issues/539#issuecomment-581795400 using your GitHub account

Received on Tuesday, 4 February 2020 08:26:56 UTC