webrtc getStats

610 views
Skip to first unread message

Nitesh Bansal

unread,
Oct 15, 2015, 11:54:51 AM10/15/15
to discuss-webrtc
Hello,

I'm interested in the following statistics for a webrtc call:
1. Packet loss
2. Round trip time
3. Jitter

My question is if it is enough to call the getStats API at the end of the call?
If I fetch them at the end of call, will browser average these measurements for the whole call?

Thanks,
Nitesh


Philipp Hancke

unread,
Oct 15, 2015, 12:09:29 PM10/15/15
to discuss...@googlegroups.com
On Thu, Oct 15, 2015 at 8:54 AM, Nitesh Bansal <nitesh...@gmail.com> wrote:
Hello,

I'm interested in the following statistics for a webrtc call:
1. Packet loss
2. Round trip time
3. Jitter

My question is if it is enough to call the getStats API at the end of the call? 

Typically not.
 
If I fetch them at the end of call, will browser average these measurements for the whole call?

It will give you the last value for round trip time (which I think is updated with every stun consent check) and jitter (periodically updated?).
Packet loss is defined as an absolute number, but it's rather unhelpful to view the packet loss over the entire session.

Nitesh Bansal

unread,
Oct 16, 2015, 9:24:25 AM10/16/15
to discuss-webrtc
Hello,

I tried the following code with Chrome for the stats:

var selector = connection.getRemoteStreams()[0].getAudioTracks()[0];
                                                console.log("Media stream selector is "+selector);
                                                var connection = voxbone.WebRTC.rtcSession.connection;
                                                console.log("peer connection object is "+connection);
                                                connection.getStats(selector, function(report) {
                                                                                console.log("we are into business of stats");
                                                                                for (var i in report) {
                                                                                        var now  = report[i];
                                                                                        console.log("RTCP report of type "+now.type);
                                                                                }
                                                                        },
                                                                        function(error) {
                                                                                console.error("name :"+ error.name+ " message: "+ error.message);
                                                                        });

This code works fine with Firefox, but with Chrome (), i get the following exception:
"
Uncaught TypeError: Failed to execute 'getStats' on 'RTCPeerConnection': The callback provided as parameter 1 is not a function
"

I would really appreciate if someone can explain me what should i do for this?


Thanks,
Nitesh

Philipp Hancke

unread,
Oct 16, 2015, 10:46:24 AM10/16/15
to discuss...@googlegroups.com

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/69982368-66bb-4447-af8f-e58fed9fafe4%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages