Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTCStats::timestamp discrepancy between webrtc-stats and webrtc-pc #3004

Open
henbos opened this issue Sep 19, 2024 · 0 comments · May be fixed by #3005
Open

RTCStats::timestamp discrepancy between webrtc-stats and webrtc-pc #3004

henbos opened this issue Sep 19, 2024 · 0 comments · May be fixed by #3005

Comments

@henbos
Copy link
Contributor

henbos commented Sep 19, 2024

In webrtc-stats it says:

Timestamps are expressed with DOMHighResTimeStamp [HIGHRES-TIME], and are defined as Performance.timeOrigin + Performance.now() at the time the information is collected.

Which is consistent with most timestamps that we've defined for the last several years and ensures monotonically incrementing etc, so it's always possible to do "delta fooStat / delta timestamp".

But the timestamp definition in webrtc-pc is really old and it says:

The timestamp, of type DOMHighResTimeStamp, associated with this object. The time is relative to the UNIX epoch (Jan 1, 1970, UTC).

It doesn't really say but this sounds like a wall clock that is not necessarily always monotonically incrementing. I think this is a mistake and it should say Performance here as well to align with all other timestamps, otherwise there will be edge cases where things break.

We noticed a bug relating to wall clock vs performance where it would diverge if the laptop went to sleep and then the page resumed...

@henbos henbos linked a pull request Sep 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant