Bug 904622 - RTP stats on the about:webrtc page. r=bwc
authorJan-Ivar Bruaroey <jib@mozilla.com>
Thu, 16 Jan 2014 16:09:25 -0500
changeset 163956 434780f5d0230921e64e17d85cfb6f5678b603aa
parent 163955 87aeba6685d4ea39244a83fa5c3611aa116e08df
child 163957 a3cde257eb1b8f3c896126e8a88e82f96a3027ec
push id38593
push userryanvm@gmail.com
push dateFri, 17 Jan 2014 15:03:48 +0000
treeherdermozilla-inbound@3687b6b2e48d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc
bugs904622
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 904622 - RTP stats on the about:webrtc page. r=bwc
toolkit/content/aboutWebrtc.xhtml
--- a/toolkit/content/aboutWebrtc.xhtml
+++ b/toolkit/content/aboutWebrtc.xhtml
@@ -139,27 +139,51 @@ function buildEmptyCandPairTable() {
 }
 
 function buildEmptyCandTable(local) {
   var candTable = document.createElement('table');
   candTable.appendChild(buildCandTableHeader(local));
   return candTable;
 }
 
+function round00(num) {
+  return Math.round(num * 100) / 100;
+}
+
 function buildPcDiv(stats, pcDivId) {
   var newPcDiv = document.createElement('div');
 
   var heading = document.createElement('h3');
   heading.appendChild(document.createTextNode(pcDivId));
   newPcDiv.appendChild(heading);
 
   var subDivs = {};
 
   stats.forEach(function(stat) {
     if (!stat.componentId) {
+      var statDiv = document.createElement('div');
+      statDiv.appendChild(document.createElement('strong'))
+             .appendChild(document.createTextNode(stat.id));
+
+      var statsString = " " + new Date(stat.timestamp).toTimeString() +
+                        " " + stat.type + " SSRC: " + stat.ssrc;
+      if (stat.packetsReceived !== undefined) {
+        statsString += " Received: " + stat.packetsReceived + " packets";
+        if (stat.bytesReceived !== undefined) {
+          statsString += " (" + round00(stat.bytesReceived/1024) + " Kb)";
+        }
+        statsString += " Jitter: " + stat.jitter;
+      } else if (stat.packetsSent !== undefined) {
+        statsString += " Sent: " + stat.packetsSent + " packets";
+        if (stat.bytesSent !== undefined) {
+          statsString += " (" + round00(stat.bytesSent/1024) + " Kb)";
+        }
+      }
+      statDiv.appendChild(document.createTextNode(statsString));
+      newPcDiv.appendChild(statDiv);
       return;
     }
 
     if (!subDivs[stat.componentId]) {
       subDivs[stat.componentId] = {
         candPairTable: buildEmptyCandPairTable(),
         localCandTable: buildEmptyCandTable(true),
         remoteCandTable: buildEmptyCandTable(false)