Bug 1371841: Only send PeerConnectionImpl::RecordEndOfCallTelemetry telemetry when connection information is exchanged. draft
authorPaul Ellenbogen <pe5@cs.princeton.edu>
Fri, 09 Jun 2017 14:21:33 -0700
changeset 592005 b9ff28a7de0be7000d67fdef70c695f4d84fe779
parent 591094 e61060be36424240058f8bef4c5597f401bc8b7e
child 632694 00499dac8d4a850664e28ea8b01860ab33d6626e
push id63251
push userbmo:pe5@cs.princeton.edu
push dateFri, 09 Jun 2017 21:25:46 +0000
bugs1371841
milestone55.0a1
Bug 1371841: Only send PeerConnectionImpl::RecordEndOfCallTelemetry telemetry when connection information is exchanged. MozReview-Commit-ID: Dw6HMtdngD5
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -2911,16 +2911,22 @@ PeerConnectionImpl::PluginCrash(uint32_t
 
 void
 PeerConnectionImpl::RecordEndOfCallTelemetry() const
 {
   if (!mJsepSession) {
     return;
   }
 
+  // Exit early if no connection information was ever exchanged,
+  // This prevents distortion of telemetry data.
+  if (mLocalRequestedSDP.empty() && mRemoteRequestedSDP.empty()) {
+    return;
+  }
+
   // Bitmask used for WEBRTC/LOOP_CALL_TYPE telemetry reporting
   static const uint32_t kAudioTypeMask = 1;
   static const uint32_t kVideoTypeMask = 2;
   static const uint32_t kDataChannelTypeMask = 4;
 
   // Report end-of-call Telemetry
   if (mJsepSession->GetNegotiations() > 0) {
     Telemetry::Accumulate(Telemetry::WEBRTC_RENEGOTIATIONS,
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
@@ -733,17 +733,17 @@ private:
   bool mDtlsConnected;
 
   nsCOMPtr<nsIThread> mThread;
   // TODO: Remove if we ever properly wire PeerConnection for cycle-collection.
   nsWeakPtr mPCObserver;
 
   nsCOMPtr<nsPIDOMWindowInner> mWindow;
 
-  // The SDP sent in from JS - here for debugging.
+  // The SDP sent in from JS
   std::string mLocalRequestedSDP;
   std::string mRemoteRequestedSDP;
 
   // DTLS fingerprint
   std::string mFingerprint;
   std::string mRemoteFingerprint;
 
   // identity-related fields