Bug 1261955 - Re-activate the VIDEO_UNLOAD_STATE telemetry probe. r=SingingTree,bsmedberg draft
authorRalph Giles <giles@mozilla.com>
Thu, 21 Apr 2016 15:08:18 -0700
changeset 363874 72d9d3ffe6471d4dc49d42e20da0bbf18f76008b
parent 363873 b13b1f15195a0a1871a5f61101ddc77e840d9049
child 520157 45d68845bd236d9b870596b0d40867d5caa02990
push id17329
push userbmo:giles@thaumas.net
push dateThu, 05 May 2016 19:43:28 +0000
reviewersSingingTree, bsmedberg
bugs1261955
milestone49.0a1
Bug 1261955 - Re-activate the VIDEO_UNLOAD_STATE telemetry probe. r=SingingTree,bsmedberg Rename the VIDEO_MSE_UNLOAD_STATE telemetry probe to just VIDEO_UNLOAD STATE and reactivate it. We were using this to track MSE deployment success and would now like to generalize it to all media playback. We can remove this probe from histogram-whitelists.json because we now define alert emails and bug numbers. MozReview-Commit-ID: Jwmdkgl8CC3
dom/html/HTMLMediaElement.cpp
toolkit/components/telemetry/Histograms.json
toolkit/components/telemetry/histogram-whitelists.json
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -2831,32 +2831,32 @@ HTMLMediaElement::ReportMSETelemetry()
               (ranges->End(index, ignore) - t) < errorMargin;
     stalled |= mDecoder && NextFrameStatus() == MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE_BUFFERING &&
                mReadyState == HTMLMediaElement::HAVE_CURRENT_DATA;
     if (stalled) {
       state = STALLED;
     }
   }
 
+  Telemetry::Accumulate(Telemetry::VIDEO_UNLOAD_STATE, state);
+  LOG(LogLevel::Debug, ("%p VIDEO_UNLOAD_STATE = %d", this, state));
+
   if (HTMLVideoElement* vid = HTMLVideoElement::FromContentOrNull(this)) {
     RefPtr<VideoPlaybackQuality> quality = vid->GetVideoPlaybackQuality();
     uint64_t totalFrames = quality->TotalVideoFrames();
     uint64_t droppedFrames = quality->DroppedVideoFrames();
     if (totalFrames) {
       uint32_t percentage = 100 * droppedFrames / totalFrames;
       LOG(LogLevel::Debug,
           ("Reporting telemetry DROPPED_FRAMES_IN_VIDEO_PLAYBACK"));
       Telemetry::Accumulate(Telemetry::VIDEO_DROPPED_FRAMES_PROPORTION,
                             percentage);
     }
   }
 
-  Telemetry::Accumulate(Telemetry::VIDEO_MSE_UNLOAD_STATE, state);
-  LOG(LogLevel::Debug, ("%p VIDEO_MSE_UNLOAD_STATE = %d", this, state));
-
   Telemetry::Accumulate(Telemetry::VIDEO_PLAY_TIME_MS, SECONDS_TO_MS(mPlayTime.Total()));
   LOG(LogLevel::Debug, ("%p VIDEO_PLAY_TIME_MS = %f", this, mPlayTime.Total()));
 }
 
 void HTMLMediaElement::UnbindFromTree(bool aDeep,
                                       bool aNullParent)
 {
   if (!mPaused && mNetworkState != nsIDOMHTMLMediaElement::NETWORK_EMPTY) {
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -8952,21 +8952,23 @@
     "alert_emails": ["ajones@mozilla.com"],
     "expires_in_version": "55",
     "description": "Total time spent playing video in milliseconds. This reports the total play time for an HTML Media Element whenever it is suspended or resumed, such as when the page is unloaded, or when the mute status changes when the AudioChannelAPI pref is set.",
     "kind": "exponential",
     "high": 7200000,
     "n_buckets": 100,
     "bug_numbers": [1261955, 1127646]
   },
-  "VIDEO_MSE_UNLOAD_STATE": {
-    "expires_in_version": "45",
+  "VIDEO_UNLOAD_STATE": {
+    "alert_emails": ["ajones@mozilla.com"],
+    "expires_in_version": "55",
     "kind": "enumerated",
     "n_values": 5,
-    "description": "MSE video state when unloading. ended = 0, paused = 1, stalled = 2, seeking = 3, other = 4"
+    "description": "HTML Media Element state when unloading. ended = 0, paused = 1, stalled = 2, seeking = 3, other = 4",
+    "bug_numbers": [1261955, 1261955]
   },
   "VIDEO_ADOBE_GMP_DISAPPEARED": {
     "alert_emails": ["cpearce@mozilla.com"],
     "expires_in_version": "50",
     "kind": "flag",
     "description": "Whether or not the Adobe EME GMP was expected to be resident on disk but mysteriously isn't.",
     "releaseChannelCollection": "opt-out"
   },
--- a/toolkit/components/telemetry/histogram-whitelists.json
+++ b/toolkit/components/telemetry/histogram-whitelists.json
@@ -1013,17 +1013,16 @@
     "VIDEO_CANPLAYTYPE_H264_CONSTRAINT_SET_FLAG",
     "VIDEO_CANPLAYTYPE_H264_LEVEL",
     "VIDEO_CANPLAYTYPE_H264_PROFILE",
     "VIDEO_DECODED_H264_SPS_CONSTRAINT_SET_FLAG",
     "VIDEO_DECODED_H264_SPS_LEVEL",
     "VIDEO_DECODED_H264_SPS_PROFILE",
     "VIDEO_EME_PLAY_SUCCESS",
     "VIDEO_H264_SPS_MAX_NUM_REF_FRAMES",
-    "VIDEO_MSE_UNLOAD_STATE",
     "WEAVE_COMPLETE_SUCCESS_COUNT",
     "WEAVE_CONFIGURED",
     "WEAVE_CONFIGURED_MASTER_PASSWORD",
     "WEAVE_START_COUNT",
     "WEBCRYPTO_ALG",
     "WEBCRYPTO_EXTRACTABLE_ENC",
     "WEBCRYPTO_EXTRACTABLE_GENERATE",
     "WEBCRYPTO_EXTRACTABLE_IMPORT",
@@ -2378,17 +2377,16 @@
     "VIDEO_DECODED_H264_SPS_PROFILE",
     "VIDEO_EME_ADOBE_HIDDEN_REASON",
     "VIDEO_EME_ADOBE_INSTALL_FAILED_REASON",
     "VIDEO_EME_ADOBE_UNSUPPORTED_REASON",
     "VIDEO_EME_PLAY_SUCCESS",
     "VIDEO_EME_REQUEST_FAILURE_LATENCY_MS",
     "VIDEO_EME_REQUEST_SUCCESS_LATENCY_MS",
     "VIDEO_H264_SPS_MAX_NUM_REF_FRAMES",
-    "VIDEO_MSE_UNLOAD_STATE",
     "VIDEO_OPENH264_GMP_DISAPPEARED",
     "VIDEO_OPENH264_GMP_MISSING_FILES",
     "VIEW_SOURCE_EXTERNAL_RESULT_BOOLEAN",
     "VIEW_SOURCE_IN_BROWSER_OPENED_BOOLEAN",
     "VIEW_SOURCE_IN_WINDOW_OPENED_BOOLEAN",
     "WEAVE_COMPLETE_SUCCESS_COUNT",
     "WEAVE_CONFIGURED",
     "WEAVE_CONFIGURED_MASTER_PASSWORD",