From dbea6f45b8f4bfc7e2483ed0576a94aeb46d384b Mon Sep 17 00:00:00 2001 From: Gerald Squelart Date: Fri, 2 Jun 2017 10:43:45 +1200 Subject: [PATCH] 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 --HG-- extra : rebase_source : bed0ea1d58f864463926478b0f8ea59e7084c4af --- dom/media/MediaCache.cpp | 9 +++++++++ toolkit/components/telemetry/Histograms.json | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/dom/media/MediaCache.cpp b/dom/media/MediaCache.cpp index ee44abf07992..646605e9df57 100644 --- a/dom/media/MediaCache.cpp +++ b/dom/media/MediaCache.cpp @@ -1966,6 +1966,15 @@ MediaCacheStream::~MediaCacheStream() 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 diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index c065bbb3f64d..34c55156f934 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -8398,6 +8398,16 @@ "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"],