Deprecate and remove legacy getStats() API |
|
Issue description
This is a tracking bug for the work of deprecating and eventually removing the legacy non-spec compliant version of the getStats() API.
The legacy version is the callback-based version.
Example: pc.getStats(r => { console.log(r); })
The spec-compliant version is the promise-based version.
Example: pc.getStats().then(r => { console.log(r); })
The two versions return different stats in different formats.
Legacy version returns undocumented stats, many of which are implementation-specific. The spec-compliant version returns stats as documented in https://w3c.github.io/webrtc-stats/.
Timeframe TBD. The legacy API is heavily relied upon by third parties and the spec-compliant replacement. In order to deprecate the new API must be matured with processes in place, including:
- Figure out if there are any stats not implemented in new API blocking migration.
- If a dev is proposing a stat, within a reasonable time frame the dev must know what
the next step is, i.e.
- Create a PR on main spec, or in some cases provisional spec. And
- Implement and expose, or
- Implement behind flag, or
- Implement as experimental
- Experimental stats must be possible, but isolated e.g. to Origin Trials.
- BAN adding stats to the legacy getStats() API.
Status as of this bug: Both APIs are supported. Legacy getStats() is mostly in maintenance mode, new stats are usually discouraged. Adding new stats to new API is preferred, but resources to do so is mostly deferred to devs requesting them. Origin Trial design doc WIP. Creating a "how to" for stats process on the TODO list, not started.
,
Jan 3
FYI, the legacy callback getStats() API is being removed from Firefox in 65.
,
Jan 4
Thanks ngrunbaum! Does the Firefox legacy callback API and the Firefox promise-based API return the same set of stats? Chrome's callback-based API returns a completely different set of stats that are non-standard which makes it harder to remove because users can't simply change the syntax of their calling-place, they get very different stats which breaks any processing they might do.
,
Jan 4
@hbos, Yes Firefox legacy callback API and the Firefox promise-based API returns the same set of stats.
,
Jan 4
Correction, it is being removed in Firefox 66. @hbos, @karthik, there are differences between the two sets of stats, but all of the information is available in both. If one coded against the results of the callback API, there definitely could be breakages when switching to the promise API. |
|
►
Sign in to add a comment |
|
Comment 1 by bugdroid1@chromium.org
, Jul 23