Check out our Amazon Connect solution! Learn More

PSA: callstats.js deprecating non-Promise getStats in 2021/02

By callstats on December 2, 2020

On 01 February 2021, callstats will deprecate the use of non-promise getStats(). This will notably stop the collection of goog- prefixed stats (googMetrics) and hence will disappear from the callstats dashboard.

History of googMetrics

googMetrics are non-standard metrics reported within the non-promise getStats() API. These metrics were introduced by developers as part of experiments to help define the eventual standardised metrics in webrc-stats

WebRTC Stats sets a strict and a high bar to standardise metrics. The standardised metrics should be well-defined and documented in a reasonable way, for different browsers to independently implement them without looking at each others code.

The googMetrics existed in the early releases of chrome webrtc as part of the non-promise API, with a completely different dictionary structure to the standardised getStats. In M57, the Chrome team implemented the standard getStats() and the initial dictionary comprised of basic metrics. The apps could have transitioned to the new API immediately, however, several metrics that the products relied on were missing, for example, round-trip time (latency) was notably missing. This made the transition to the new API difficult for several apps/product that relied on these metrics.

callstats from the beginning solved the problem by converting the output of the non-promise API into the output of the promise-based API. When the new API was released by Chrome, we merged the stats from the two Chrome APIs to provide a holistic output.

However, over the last 2 years, the Chrome team has moved and replaced the googMetrics with the standardised webrtc-stats counterparts. Since M57, the Chrome team released several update, notably M75 and M84, which exposed the remote inbound stats and several audio sample stats that reduced the reliance on non-promise getStats.


Next Steps

callstats.js v3.67 introduced the collectLegacyStats flag, which is currently set to true, on 01 February 2021, the default will be set to false, which means if your application still relies on the non-promise, you will need to update the app to set the collectLegacyStats to true.

let params = {
siteID: "finland",
additionalIDs: additionalIDs,
collectLegacyStats: true //enables the collection of legacy stats in chrome browser

let callStats = new callstats();

callStats.initialize(appId, appSecret, "", csInitCallback, null, params);


Tags: REST API, psa