- From: Justin Uberti <juberti@google.com>
- Date: Thu, 7 Feb 2013 09:07:10 -0800
- To: "public-webrtc@w3.org" <public-webrtc@w3.org>
- Message-ID: <CAOJ7v-0vucr_4v3VjaYf5TrOgwVysjdSi20Ge97yJTef9RyFTw@mail.gmail.com>
Here is a summary of what I *think* we decided to do in WEBRTC regarding
stats this morning.
*Proposal:*
getStats(selector, cb) gives you back (in the callback) a RTCStatsReport
(unchanged from previous proposal).
RTCStatsReport now becomes a map<id, RTCStatsObject>; you can look up a
report by id, or iterate over them all.
The RTCStatsObject has properties
- timestamp (units are DOMHiResTimestamp, http://www.w3.org/TR/hr-time/)
- type (name of stats child class, e.g. "OutgoingRTPStream")
- id (opaque string)
And there are various descendant classes of RTCStatsObject, e.g
*interface RTCRTPStreamStats : RTCStatsObject {
int ssrc;
StatsObjectID? otherEndStats; // Reference to the stats signalled from our
partner.
};
interface RTCOutgoingRTPStreamStats : RTCRTPStreamStats {
int packetsSent;
long bytesSent;
};*
*
*
*interface RTCIncomingRTPStreamStats : RTCRTPStreamStats {
int packetsReceived;
long bytesReceived;*
* int packetsLost;
};*
*
*
*(Names are subject to change)*
*
*
*Sample Usage:*
*
*
getStats(null, onStats);
onStats = function(report) {
for (var id in report) {
var obj = report[id];
if (obj.type == "RTCIncomingRTPStreamStats") {
// print out the number of bytes received on each RTP stream
console.log(obj.timestamp + ": ssrc:" + obj.ssrc + " bytes:" +
obj.bytesReceived);
}
}
Received on Thursday, 7 February 2013 17:07:58 UTC