Bug 1188407: switch packetloss to a rate from total-packets-lost-per-update r=jib
authorRandell Jesup <rjesup@jesup.org>
Tue, 11 Aug 2015 15:15:06 -0400
changeset 257296 bd0b693e8c8f9f15b5e9af08980a12434a9d43b0
parent 257295 5d44c5c1195c8f8880f3d76e03576f35dc1b78d6
child 257297 f73f15ea2b8ea5e1654078b2bae16172af2c1f0f
push id63583
push userrjesup@wgate.com
push dateTue, 11 Aug 2015 19:15:30 +0000
treeherdermozilla-inbound@bd0b693e8c8f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1188407
milestone43.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 1188407: switch packetloss to a rate from total-packets-lost-per-update r=jib
media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp
toolkit/components/telemetry/Histograms.json
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp
@@ -215,31 +215,41 @@ EverySecondTelemetryCallback_s(nsAutoPtr
           lastInboundStats = &ctx->mLastReports[i]->mInboundRTPStreamStats.Value();
         }
       }
       // Then, look for the things we want telemetry on
       auto& array = r.mInboundRTPStreamStats.Value();
       for (decltype(array.Length()) i = 0; i < array.Length(); i++) {
         auto& s = array[i];
         bool isAudio = (s.mId.Value().Find("audio") != -1);
-        if (s.mPacketsLost.WasPassed()) {
-          Accumulate(s.mIsRemote?
-                     (isAudio? WEBRTC_AUDIO_QUALITY_OUTBOUND_PACKETLOSS :
-                               WEBRTC_VIDEO_QUALITY_OUTBOUND_PACKETLOSS) :
-                     (isAudio? WEBRTC_AUDIO_QUALITY_INBOUND_PACKETLOSS :
-                               WEBRTC_VIDEO_QUALITY_INBOUND_PACKETLOSS),
-                      s.mPacketsLost.Value());
+        if (s.mPacketsLost.WasPassed() && s.mPacketsReceived.WasPassed() &&
+            (s.mPacketsLost.Value() + s.mPacketsReceived.Value()) != 0) {
+          ID id;
+          if (s.mIsRemote) {
+            id = isAudio ? WEBRTC_AUDIO_QUALITY_OUTBOUND_PACKETLOSS_RATE :
+                           WEBRTC_VIDEO_QUALITY_OUTBOUND_PACKETLOSS_RATE;
+          } else {
+            id = isAudio ? WEBRTC_AUDIO_QUALITY_INBOUND_PACKETLOSS_RATE :
+                           WEBRTC_VIDEO_QUALITY_INBOUND_PACKETLOSS_RATE;
+          }
+          // *1000 so we can read in 10's of a percent (permille)
+          Accumulate(id,
+                     (s.mPacketsLost.Value() * 1000) /
+                     (s.mPacketsLost.Value() + s.mPacketsReceived.Value()));
         }
         if (s.mJitter.WasPassed()) {
-          Accumulate(s.mIsRemote?
-                     (isAudio? WEBRTC_AUDIO_QUALITY_OUTBOUND_JITTER :
-                               WEBRTC_VIDEO_QUALITY_OUTBOUND_JITTER) :
-                     (isAudio? WEBRTC_AUDIO_QUALITY_INBOUND_JITTER :
-                               WEBRTC_VIDEO_QUALITY_INBOUND_JITTER),
-                      s.mJitter.Value());
+          ID id;
+          if (s.mIsRemote) {
+            id = isAudio ? WEBRTC_AUDIO_QUALITY_OUTBOUND_JITTER :
+                           WEBRTC_VIDEO_QUALITY_OUTBOUND_JITTER;
+          } else {
+            id = isAudio ? WEBRTC_AUDIO_QUALITY_INBOUND_JITTER :
+                           WEBRTC_VIDEO_QUALITY_INBOUND_JITTER;
+          }
+          Accumulate(id, s.mJitter.Value());
         }
         if (s.mMozRtt.WasPassed()) {
           MOZ_ASSERT(s.mIsRemote);
           ID id;
           if (isAudio) {
             id = isHello ? LOOP_AUDIO_QUALITY_OUTBOUND_RTT :
                            WEBRTC_AUDIO_QUALITY_OUTBOUND_RTT;
           } else {
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -6189,38 +6189,38 @@
   },
   "WEBRTC_AUDIO_QUALITY_OUTBOUND_BANDWIDTH_KBITS": {
     "expires_in_version": "never",
     "kind": "exponential",
     "high": 1000000,
     "n_buckets": 1000,
     "description": "Data rate deduced from RTCP from remote recipient of outbound audio (kbit/s). Computed every second of a call (for easy comparison)."
   },
-  "WEBRTC_VIDEO_QUALITY_INBOUND_PACKETLOSS": {
+  "WEBRTC_VIDEO_QUALITY_INBOUND_PACKETLOSS_RATE": {
     "expires_in_version": "never",
     "kind": "exponential",
     "high": 1000,
     "n_buckets": 100,
     "description": "Locally measured packet loss on inbound video (permille). Sampled every second of a call."
   },
-  "WEBRTC_AUDIO_QUALITY_INBOUND_PACKETLOSS": {
+  "WEBRTC_AUDIO_QUALITY_INBOUND_PACKETLOSS_RATE": {
     "expires_in_version": "never",
     "kind": "exponential",
     "high": 1000,
     "n_buckets": 100,
     "description": "Locally measured packet loss on inbound audio (permille). Sampled every second of a call."
   },
-  "WEBRTC_VIDEO_QUALITY_OUTBOUND_PACKETLOSS": {
+  "WEBRTC_VIDEO_QUALITY_OUTBOUND_PACKETLOSS_RATE": {
     "expires_in_version": "never",
     "kind": "exponential",
     "high": 1000,
     "n_buckets": 100,
     "description": "RTCP-reported packet loss by remote recipient of outbound video (permille). Sampled every second of a call (for easy comparison)."
   },
-  "WEBRTC_AUDIO_QUALITY_OUTBOUND_PACKETLOSS": {
+  "WEBRTC_AUDIO_QUALITY_OUTBOUND_PACKETLOSS_RATE": {
     "expires_in_version": "never",
     "kind": "exponential",
     "high": 1000,
     "n_buckets": 100,
     "description": "RTCP-reported packet loss by remote recipient of outbound audio (permille). Sampled every second of a call (for easy comparison)."
   },
   "WEBRTC_VIDEO_QUALITY_INBOUND_JITTER": {
     "expires_in_version": "never",