Re: [webrtc-stats] Clarify that metrics are undefined when their value is not yet determined or unknown (#736)

Yeah, this is mostly wordsmithing. But behold, this is a can of worms.

IMO encoderImplementation/decoderImplementation fall under this
```
When a counted feature hasn't been used yet, but may happen in the future, report a count of zero.
```
but for strings. For these it may make sense to include the empty string despite guidance against this in the sentence before.
I *think* it is the only two cases? Easy... but behold...

"may happen in the future" is vague. What this means is you:
* should include packetsLost (even though you may never loose a packet)
since it means that you can safely subtract stats from two times T_a and T_b without worrying about a value being undefined a T_a.

This applies to some things that are not "counted" but should be covered like [STUN](https://w3c.github.io/webrtc-stats/#dom-rtcicecandidatepairstats-totalroundtriptime) RTT. This should be 0 initially and be present. It is clear that this has not happened yet because responsesReceived is still 0.

STUN currentRoundTripTime however should not be present before a response has been received.
Neither should audioLevel before you decode or send a packet.
Both values are instantaneous. Following that logic, decoderImplementation should not be set either.

For RTCP we have conflicting guidance in [here](https://w3c.github.io/webrtc-stats/#dictionary-rtcremoteinboundrtpstreamstats-members) to only include when a RR with a non-zero DLSR field was received (and yep, that takes some time, say hello to flaky tests). This seems slightly off, the intention is to count valid round trip times and only increment for those.


Now trying to summarize that I would say the guidance should be
* When a cumulative feature hasn't been used yet report a count of zero so stats values from two points in time can be safely subtracted.
* When an momentary feature hasn't been used yet, omit the dictionary member

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 2 March 2023 13:08:15 UTC