Bug 1556766 - Add telemetry for WebRTC video codecs used in calls; r=chutten,drno, a=RyanVM
authorDan Minor <dminor@mozilla.com>
Mon, 10 Jun 2019 20:28:23 +0000
changeset 536849 0199db54157108d082011d30ae4a6c9788a38e83
parent 536848 1c5156a0ede91bcce7b87450387a3ebbdfa4037b
child 536850 5f3696bcf6bb2ee2d640a20b2826984dad6d5c6e
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschutten, drno, RyanVM
bugs1556766
milestone68.0
Bug 1556766 - Add telemetry for WebRTC video codecs used in calls; r=chutten,drno, a=RyanVM This adds a scalar for the codecs used when receiving and sending video in a WebRTC call. Differential Revision: https://phabricator.services.mozilla.com/D33840
media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
toolkit/components/telemetry/Scalars.yaml
--- a/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
+++ b/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
@@ -607,16 +607,22 @@ webrtc::VideoCodecType SupportedCodecTyp
   }
   // NOTREACHED
 }
 
 MediaConduitErrorCode WebrtcVideoConduit::CreateSendStream() {
   MOZ_ASSERT(NS_IsMainThread());
   mMutex.AssertCurrentThreadOwns();
 
+  nsAutoString codecName;
+  codecName.AssignASCII(
+      mSendStreamConfig.encoder_settings.payload_name.c_str());
+  Telemetry::ScalarAdd(Telemetry::ScalarID::WEBRTC_VIDEO_SEND_CODEC_USED,
+                       codecName, 1);
+
   webrtc::VideoCodecType encoder_type =
       SupportedCodecType(webrtc::PayloadStringToCodecType(
           mSendStreamConfig.encoder_settings.payload_name));
   if (encoder_type == webrtc::VideoCodecType::kVideoCodecUnknown) {
     return kMediaConduitInvalidSendCodec;
   }
 
   std::unique_ptr<webrtc::VideoEncoder> encoder(CreateEncoder(encoder_type));
@@ -662,16 +668,21 @@ MediaConduitErrorCode WebrtcVideoConduit
   mMutex.AssertCurrentThreadOwns();
 
   webrtc::VideoReceiveStream::Decoder decoder_desc;
   std::unique_ptr<webrtc::VideoDecoder> decoder;
   webrtc::VideoCodecType decoder_type;
 
   mRecvStreamConfig.decoders.clear();
   for (auto& config : mRecvCodecList) {
+    nsAutoString codecName;
+    codecName.AssignASCII(config->mName.c_str());
+    Telemetry::ScalarAdd(Telemetry::ScalarID::WEBRTC_VIDEO_RECV_CODEC_USED,
+                         codecName, 1);
+
     decoder_type =
         SupportedCodecType(webrtc::PayloadStringToCodecType(config->mName));
     if (decoder_type == webrtc::VideoCodecType::kVideoCodecUnknown) {
       CSFLogError(LOGTAG, "%s Unknown decoder type: %s", __FUNCTION__,
                   config->mName.c_str());
       continue;
     }
 
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -946,16 +946,47 @@ webrtc.nicer:
     notification_emails:
       - webrtc-ice-telemetry-alerts@mozilla.com
       - nohlmeier@mozilla.com
     release_channel_collection: opt-in
     record_in_processes:
       - 'main'
       - 'content'
 
+webrtc.video:
+  recv_codec_used:
+    bug_numbers:
+      - 1556766
+    description: >
+      The video codec used for receiving video on a WebRTC call.
+    expires: "never"
+    kind: uint
+    keyed: true
+    notification_emails:
+      - dminor@mozilla.com
+      - nohlmeier@mozilla.com
+    release_channel_collection: opt-out
+    record_in_processes:
+      - 'content'
+
+  send_codec_used:
+    bug_numbers:
+      - 1556766
+    description: >
+      The video codec used for sending video on a WebRTC call.
+    expires: "never"
+    kind: uint
+    keyed: true
+    notification_emails:
+      - dminor@mozilla.com
+      - nohlmeier@mozilla.com
+    release_channel_collection: opt-out
+    record_in_processes:
+      - 'content'
+
 webrtc.sdp:
   parser_diff:
     bug_numbers:
       - 1432955
       - 1529787
     description: >
       The number of differences between the C based sipcc SDP parser and
       the new rust based rsdparsa SDP parser keyed by predefined