W3C home > Mailing lists > Public > public-webrtc@w3.org > August 2014

Re: getStats on closed peerConnection

From: Harald Alvestrand <harald@alvestrand.no>
Date: Wed, 20 Aug 2014 23:37:25 +0200
Message-ID: <53F51515.7080804@alvestrand.no>
To: public-webrtc@w3.org
On 08/20/2014 11:03 PM, Jan-Ivar Bruaroey wrote:
> I'd like to propose a change to getStats so that calling it on a 
> closed PeerConnection does not throw, but instead gives you the stats 
> at the time the PeerConnection closed.

Chrome has worked that way forever, exactly for that reason.

I'm filing this as a bug [bug 26620]. Thanks for catching it!


>
> Use-case: A webpage wants stats about the call that just terminated 
> from the other side - e.g. how many frames dropped?
>
> In [1] remove step 1:
>>     1. If the ||RTCPeerConnection| 
>> <http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCPeerConnection>| 
>> object's |RTCPeerConnection| signalingState 
>> <http://dev.w3.org/2011/webrtc/editor/webrtc.html#dom-peerconnection-signaling-state> 
>> is |closed|, throw an |InvalidStateError| exception. 
>
> And edit step 5 (which would now be 4):
>
>>     4. Start gathering the stats indicated by selectorArg. In case 
>> selectorArg is null, stats /MUST/ be gathered for the whole 
>> ||RTCPeerConnection| 
>> <http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCPeerConnection>| 
>> object. If the ||RTCPeerConnection| 
>> <http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCPeerConnection>| 
>> object's |RTCPeerConnection| signalingState 
>> <http://dev.w3.org/2011/webrtc/editor/webrtc.html#dom-peerconnection-signaling-state> 
>> is |closed|, stats should reflect the state at or near the time that 
>> signalingState 
>> <http://dev.w3.org/2011/webrtc/editor/webrtc.html#dom-peerconnection-signaling-state> 
>> transitioned to |closed|.
>
> Implementations would basically cache a final call to getStats 
> internally as part of transitioning to closed.
>
> .: Jan-Ivar :.
>
> [1] http://dev.w3.org/2011/webrtc/editor/webrtc.html#methods-5
>
Received on Wednesday, 20 August 2014 21:37:57 UTC

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