Bug 1369538 - Telemetry MEDIACACHESTREAM_LENGTH_KB - r=cpearce,francois
☠☠ backed out by c552b68a1c94 ☠ ☠
authorGerald Squelart <gsquelart@mozilla.com>
Fri, 02 Jun 2017 10:43:45 +1200
changeset 361942 12e990a890185866669feb776ea1d46c511f3892
parent 361941 d6d27f07a746cba107c67a8d801b0efca31094ee
child 361943 ca6881983573316f6d20ea12085a81f34b13ed27
push id31952
push usercbook@mozilla.com
push dateFri, 02 Jun 2017 12:17:25 +0000
treeherdermozilla-central@194c009d6295 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce, francois
bugs1369538
milestone55.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 1369538 - Telemetry MEDIACACHESTREAM_LENGTH_KB - r=cpearce,francois Capture each media stream's length (as provided, otherwise as actually downloaded), to gauge whether keeping media in memory would have a significant impact. MozReview-Commit-ID: 4yUQrbgLcGG
dom/media/MediaCache.cpp
toolkit/components/telemetry/Histograms.json
--- a/dom/media/MediaCache.cpp
+++ b/dom/media/MediaCache.cpp
@@ -1961,16 +1961,25 @@ MediaCacheStream::~MediaCacheStream()
   NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
   NS_ASSERTION(!mPinCount, "Unbalanced Pin");
 
   if (gMediaCache) {
     NS_ASSERTION(mClosed, "Stream was not closed");
     gMediaCache->ReleaseStream(this);
     MediaCache::MaybeShutdown();
   }
+
+  uint32_t lengthKb = uint32_t(
+    std::min(std::max(mStreamLength, int64_t(0)) / 1024, int64_t(UINT32_MAX)));
+  LOG("MediaCacheStream::~MediaCacheStream(this=%p) "
+      "MEDIACACHESTREAM_LENGTH_KB=%" PRIu32,
+      this,
+      lengthKb);
+  Telemetry::Accumulate(Telemetry::HistogramID::MEDIACACHESTREAM_LENGTH_KB,
+                        lengthKb);
 }
 
 void
 MediaCacheStream::SetTransportSeekable(bool aIsTransportSeekable)
 {
   ReentrantMonitorAutoEnter mon(gMediaCache->GetReentrantMonitor());
   NS_ASSERTION(mIsTransportSeekable || aIsTransportSeekable ||
                mChannelOffset == 0, "channel offset must be zero when we become non-seekable");
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -8393,16 +8393,26 @@
     "record_in_processes": ["main", "content"],
     "alert_emails": ["gsquelart@mozilla.com"],
     "bug_numbers": [1366936],
     "expires_in_version": "60",
     "kind": "enumerated",
     "n_values": 32,
     "description": "Maximum number of owners for each MediaCache block. Recorded at every MediaCache destruction, i.e., whenever there is no more media data to be downloaded or kept for playback."
   },
+  "MEDIACACHESTREAM_LENGTH_KB": {
+    "record_in_processes": ["main", "content"],
+    "alert_emails": ["gsquelart@mozilla.com"],
+    "bug_numbers": [1369538],
+    "expires_in_version": "60",
+    "kind": "linear",
+    "high": 520000,
+    "n_buckets": 66,
+    "description": "MediaCacheStream stream length size in KB; Either known size from the HTTP header if available, or otherwise the size actually downloaded. Recorded at every MediaCacheStream destruction."
+  },
   "VIDEO_MFT_OUTPUT_NULL_SAMPLES": {
     "record_in_processes": ["main", "content"],
     "alert_emails": ["cpearce@mozilla.com"],
     "expires_in_version": "53",
     "kind": "enumerated",
     "n_values": 10,
     "description": "Does the WMF video decoder return success but null output? 0 = playback successful, 1 = excessive null output but able to decode some frames, 2 = excessive null output and gave up, 3 = null output but recovered, 4 = non-excessive null output without being able to decode frames.",
     "bug_numbers": [1176071]