W3C home > Mailing lists > Public > public-webrtc@w3.org > February 2013

Re: How to use stats

From: Justin Uberti <juberti@google.com>
Date: Thu, 7 Feb 2013 09:08:39 -0800
Message-ID: <CAOJ7v-3As2LbbE-5smhPc3shPbiBYBzj_KL05p6F8ucWiL5hAw@mail.gmail.com>
To: Martin Thomson <martin.thomson@gmail.com>
Cc: "public-webrtc@w3.org" <public-webrtc@w3.org>
I would think we would have to set type based on the most specific type.


On Thu, Feb 7, 2013 at 8:56 AM, Martin Thomson <martin.thomson@gmail.com>wrote:

> Given the API that we decided to go with, here is code that will
> produce one line (to console) for each RTP stream that includes a
> timestamp and the ssrc for those streams.
>
> function statsCallback(allStats) {
>   var stats = getStatsByType(allStats, 'RTPStreamStats');
>   stats.forEach(function(v) {
>     console.log(v.timestamp + ' ' + v.id + ' ' + v.ssrc);
>   });
> }
>
> function getStatsByType(allStats, type) {
>   return Object.keys(allStats).filter(function(id) {
>     return allStats[id].type === allStats;
>   }).map(function(id) {
>     return allStats[id];
>   });
> }
>
> Question: do we set type for an RTCStatsObject based on the most
> specific type?  That would invalidate the filtering I'm doing here.
>
>
Received on Thursday, 7 February 2013 17:09:27 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:32 UTC