Bug 1402221: add Telemetry probe to find out rtcp-mux usage. r?bwc draft
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Fri, 22 Sep 2017 00:09:52 -0700
changeset 669435 1e613129aa7e062d661bd2d1312b728d14af33f9
parent 669354 3d72fdb0e561ea59d9e5850c3e71367dbb8a7148
child 732952 811fe31b7df2e772db79961eed84f9596493640e
push id81325
push userdrno@ohlmeier.org
push dateSat, 23 Sep 2017 03:37:35 +0000
reviewersbwc
bugs1402221
milestone58.0a1
Bug 1402221: add Telemetry probe to find out rtcp-mux usage. r?bwc MozReview-Commit-ID: 1XmPbpSmAb1
media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
toolkit/components/telemetry/Histograms.json
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
@@ -12,16 +12,17 @@
 #include "nspr.h"
 #include "nss.h"
 #include "pk11pub.h"
 #include "nsDebug.h"
 #include "logging.h"
 
 #include "mozilla/Move.h"
 #include "mozilla/UniquePtr.h"
+#include "mozilla/Telemetry.h"
 
 #include "webrtc/config.h"
 
 #include "signaling/src/jsep/JsepTrack.h"
 #include "signaling/src/jsep/JsepTrack.h"
 #include "signaling/src/jsep/JsepTransport.h"
 #include "signaling/src/sdp/Sdp.h"
 #include "signaling/src/sdp/SipccSdp.h"
@@ -1529,16 +1530,21 @@ JsepSessionImpl::MakeNegotiatedTrackPair
 
   if (transport->mComponents == 2) {
     // RTCP MUX or not.
     // TODO(bug 1095743): verify that the PTs are consistent with mux.
     MOZ_MTLOG(ML_DEBUG, "RTCP-MUX is off");
     trackPairOut->mRtcpTransport = transport;
   }
 
+  if (local.GetMediaType() != SdpMediaSection::kApplication) {
+    Telemetry::Accumulate(Telemetry::WEBRTC_RTCP_MUX,
+        transport->mComponents == 1);
+  }
+
   return NS_OK;
 }
 
 void
 JsepSessionImpl::InitTransport(const SdpMediaSection& msection,
                                JsepTransport* transport)
 {
   if (mSdpHelper.MsectionIsDisabled(msection)) {
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -9215,16 +9215,24 @@
   },
   "WEBRTC_DATACHANNEL_NEGOTIATED": {
     "record_in_processes": ["main", "content"],
     "alert_emails": ["webrtc-telemetry-alerts@mozilla.com"],
     "expires_in_version": "never",
     "kind": "boolean",
     "description": "Was DataChannels negotiated"
   },
+  "WEBRTC_RTCP_MUX": {
+    "record_in_processes": ["main", "content"],
+    "bug_numbers": [1402221],
+    "alert_emails": ["webrtc-telemetry-alerts@mozilla.com", "nohlmeier@mozilla.com"],
+    "expires_in_version": "62",
+    "kind": "boolean",
+    "description": "Was RTCP-MUX negotiated for a track"
+  },
   "WEBRTC_CALL_TYPE": {
     "record_in_processes": ["main", "content"],
     "alert_emails": ["webrtc-telemetry-alerts@mozilla.com"],
     "expires_in_version": "never",
     "kind": "enumerated",
     "n_values": 8,
     "description": "Type of call: (Bitmask) Audio = 1, Video = 2, DataChannels = 4"
   },