Bug 1371205 - MEDIACACHESTREAM_NOTIFIED_LENGTH captures the HTTP header length given to MediaCacheStream - r?cpearce,francois
MozReview-Commit-ID: 9muZcpfD2vG
--- a/dom/media/MediaCache.cpp
+++ b/dom/media/MediaCache.cpp
@@ -1758,16 +1758,26 @@ MediaCache::NoteSeek(MediaCacheStream* a
}
}
void
MediaCacheStream::NotifyDataLength(int64_t aLength)
{
NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
+ if (mStreamLength < 0 && aLength >= 0) {
+ uint32_t length = uint32_t(std::min(aLength, int64_t(UINT32_MAX)));
+ LOG("MediaCacheStream::NotifyDataLength(this=%p) "
+ "MEDIACACHESTREAM_NOTIFIED_LENGTH=%" PRIu32,
+ this,
+ length);
+ Telemetry::Accumulate(
+ Telemetry::HistogramID::MEDIACACHESTREAM_NOTIFIED_LENGTH, length);
+ }
+
ReentrantMonitorAutoEnter mon(gMediaCache->GetReentrantMonitor());
mStreamLength = aLength;
}
void
MediaCacheStream::NotifyDataStarted(int64_t aOffset)
{
NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -8436,16 +8436,26 @@
"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."
},
+ "MEDIACACHESTREAM_NOTIFIED_LENGTH": {
+ "record_in_processes": ["main", "content"],
+ "alert_emails": ["gsquelart@mozilla.com"],
+ "bug_numbers": [1371205],
+ "expires_in_version": "60",
+ "kind": "linear",
+ "high": 16777216,
+ "n_buckets": 66,
+ "description": "MediaCacheStream stream notified length size in bytes, from the HTTP header. Recorded when each MediaCacheStream is first notified."
+ },
"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]