mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
Bug 1913624 - Remove expired telemetry histograms VIDEO_INFERRED_DECODE_SUSPEND_PERCENTAGE, VIDEO_INTER_KEYFRAME_AVERAGE_MS and VIDEO_INTER_KEYFRAME_MAX_MS, r=chutten,webidl,emilio.
Depends on D219447 Differential Revision: https://phabricator.services.mozilla.com/D219448
This commit is contained in:
parent
c0584eaa68
commit
52cde5627b
@ -2229,10 +2229,6 @@ double HTMLMediaElement::MutedPlayTime() const {
|
||||
return mDecoder ? mDecoder->GetMutedPlayTimeInSeconds() : -1.0;
|
||||
}
|
||||
|
||||
double HTMLMediaElement::VideoDecodeSuspendedTime() const {
|
||||
return mDecoder ? mDecoder->GetVideoDecodeSuspendedTimeInSeconds() : -1.0;
|
||||
}
|
||||
|
||||
void HTMLMediaElement::SetFormatDiagnosticsReportForMimeType(
|
||||
const nsAString& aMimeType, DecoderDoctorReportType aType) {
|
||||
DecoderDoctorDiagnostics diagnostics;
|
||||
|
@ -666,7 +666,6 @@ class HTMLMediaElement : public nsGenericHTMLElement,
|
||||
double TotalVideoHDRPlayTime() const;
|
||||
double VisiblePlayTime() const;
|
||||
double InvisiblePlayTime() const;
|
||||
double VideoDecodeSuspendedTime() const;
|
||||
double TotalAudioPlayTime() const;
|
||||
double AudiblePlayTime() const;
|
||||
double InaudiblePlayTime() const;
|
||||
|
@ -367,12 +367,10 @@ void MediaDecoder::OnPlaybackEvent(MediaPlaybackEvent&& aEvent) {
|
||||
break;
|
||||
case MediaPlaybackEvent::EnterVideoSuspend:
|
||||
GetOwner()->DispatchAsyncEvent(u"mozentervideosuspend"_ns);
|
||||
mTelemetryProbesReporter->OnDecodeSuspended();
|
||||
mIsVideoDecodingSuspended = true;
|
||||
break;
|
||||
case MediaPlaybackEvent::ExitVideoSuspend:
|
||||
GetOwner()->DispatchAsyncEvent(u"mozexitvideosuspend"_ns);
|
||||
mTelemetryProbesReporter->OnDecodeResumed();
|
||||
mIsVideoDecodingSuspended = false;
|
||||
break;
|
||||
case MediaPlaybackEvent::StartVideoSuspendTimer:
|
||||
@ -1680,10 +1678,6 @@ double MediaDecoder::GetInvisibleVideoPlayTimeInSeconds() const {
|
||||
return mTelemetryProbesReporter->GetInvisibleVideoPlayTimeInSeconds();
|
||||
}
|
||||
|
||||
double MediaDecoder::GetVideoDecodeSuspendedTimeInSeconds() const {
|
||||
return mTelemetryProbesReporter->GetVideoDecodeSuspendedTimeInSeconds();
|
||||
}
|
||||
|
||||
double MediaDecoder::GetTotalAudioPlayTimeInSeconds() const {
|
||||
return mTelemetryProbesReporter->GetTotalAudioPlayTimeInSeconds();
|
||||
}
|
||||
|
@ -784,7 +784,6 @@ class MediaDecoder : public DecoderDoctorLifeLogger<MediaDecoder> {
|
||||
double GetTotalVideoHDRPlayTimeInSeconds() const;
|
||||
double GetVisibleVideoPlayTimeInSeconds() const;
|
||||
double GetInvisibleVideoPlayTimeInSeconds() const;
|
||||
double GetVideoDecodeSuspendedTimeInSeconds() const;
|
||||
double GetTotalAudioPlayTimeInSeconds() const;
|
||||
double GetAudiblePlayTimeInSeconds() const;
|
||||
double GetInaudiblePlayTimeInSeconds() const;
|
||||
|
@ -14,7 +14,6 @@
|
||||
* - VIDEO_HDR_PLAY_TIME_MS
|
||||
* - VIDEO_HIDDEN_PLAY_TIME_MS
|
||||
* - VIDEO_HIDDEN_PLAY_TIME_PERCENTAGE
|
||||
* - VIDEO_INFERRED_DECODE_SUSPEND_PERCENTAGE
|
||||
* - VIDEO_VISIBLE_PLAY_TIME_MS
|
||||
* - MEDIA_PLAY_TIME_MS
|
||||
* - MUTED_PLAY_TIME_PERCENT
|
||||
@ -29,7 +28,6 @@ const videoHDRHistNames = [
|
||||
];
|
||||
const videoKeyedHistNames = [
|
||||
"VIDEO_HIDDEN_PLAY_TIME_PERCENTAGE",
|
||||
"VIDEO_INFERRED_DECODE_SUSPEND_PERCENTAGE",
|
||||
"VIDEO_VISIBLE_PLAY_TIME_MS"
|
||||
];
|
||||
const audioKeyedHistNames = [
|
||||
@ -66,7 +64,6 @@ add_task(async function testTotalPlayTime() {
|
||||
]);
|
||||
await assertValueConstantlyIncreases(videoChrome, "totalVideoPlayTime");
|
||||
assertValueKeptUnchanged(videoChrome, "invisiblePlayTime");
|
||||
assertValueKeptUnchanged(videoChrome, "videoDecodeSuspendedTime");
|
||||
|
||||
info(`should not accumulate time for paused video`);
|
||||
video.pause();
|
||||
@ -415,24 +412,17 @@ add_task(async function testDecodeSuspendedTime() {
|
||||
ok(returnTrueWhenAllValuesAreTrue(rv), "video started playing");
|
||||
await assertValueConstantlyIncreases(videoChrome, "totalVideoPlayTime");
|
||||
assertValueKeptUnchanged(videoChrome, "invisiblePlayTime");
|
||||
assertValueKeptUnchanged(videoChrome, "videoDecodeSuspendedTime");
|
||||
|
||||
info(`make it invisible and force to suspend decoding`);
|
||||
video.setVisible(false);
|
||||
await once(video, "mozvideodecodesuspendedstarted");
|
||||
await assertValueConstantlyIncreases(videoChrome, "totalVideoPlayTime");
|
||||
await assertValueConstantlyIncreases(videoChrome, "invisiblePlayTime");
|
||||
await assertValueConstantlyIncreases(videoChrome, "videoDecodeSuspendedTime");
|
||||
|
||||
info(`make it visible and resume decoding`);
|
||||
video.setVisible(true);
|
||||
await Promise.all([
|
||||
once(video, "mozinvisibleplaytimepaused"),
|
||||
once(video, "mozvideodecodesuspendedpaused"),
|
||||
]);
|
||||
await once(video, "mozinvisibleplaytimepaused");
|
||||
await assertValueConstantlyIncreases(videoChrome, "totalVideoPlayTime");
|
||||
assertValueKeptUnchanged(videoChrome, "invisiblePlayTime");
|
||||
assertValueKeptUnchanged(videoChrome, "videoDecodeSuspendedTime");
|
||||
await cleanUpMediaAndCheckTelemetry(video);
|
||||
});
|
||||
|
||||
@ -684,7 +674,6 @@ function assertAllProbeRelatedAttributesKeptUnchanged(video) {
|
||||
const videoChrome = SpecialPowers.wrap(video);
|
||||
assertValueKeptUnchanged(videoChrome, "totalVideoPlayTime");
|
||||
assertValueKeptUnchanged(videoChrome, "invisiblePlayTime");
|
||||
assertValueKeptUnchanged(videoChrome, "videoDecodeSuspendedTime");
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -246,28 +246,6 @@ void TelemetryProbesReporter::OnMediaContentChanged(MediaContent aContent) {
|
||||
mMediaContent = aContent;
|
||||
}
|
||||
|
||||
void TelemetryProbesReporter::OnDecodeSuspended() {
|
||||
AssertOnMainThreadAndNotShutdown();
|
||||
// Suspended time should only be counted after starting accumulating invisible
|
||||
// time.
|
||||
if (!mInvisibleVideoPlayTime.IsStarted()) {
|
||||
return;
|
||||
}
|
||||
LOG("Start time accumulation for video decoding suspension");
|
||||
mVideoDecodeSuspendedTime.Start();
|
||||
mOwner->DispatchAsyncTestingEvent(u"mozvideodecodesuspendedstarted"_ns);
|
||||
}
|
||||
|
||||
void TelemetryProbesReporter::OnDecodeResumed() {
|
||||
AssertOnMainThreadAndNotShutdown();
|
||||
if (!mVideoDecodeSuspendedTime.IsStarted()) {
|
||||
return;
|
||||
}
|
||||
LOG("Pause time accumulation for video decoding suspension");
|
||||
mVideoDecodeSuspendedTime.Pause();
|
||||
mOwner->DispatchAsyncTestingEvent(u"mozvideodecodesuspendedpaused"_ns);
|
||||
}
|
||||
|
||||
void TelemetryProbesReporter::OntFirstFrameLoaded(
|
||||
const double aLoadedFirstFrameTime, const double aLoadedMetadataTime,
|
||||
const double aTotalWaitingDataTime, const double aTotalBufferingTime,
|
||||
@ -362,7 +340,6 @@ void TelemetryProbesReporter::PauseInvisibleVideoTimeAccumulator() {
|
||||
if (!mInvisibleVideoPlayTime.IsStarted()) {
|
||||
return;
|
||||
}
|
||||
OnDecodeResumed();
|
||||
LOG("Pause time accumulation for invisible video");
|
||||
mInvisibleVideoPlayTime.Pause();
|
||||
mOwner->DispatchAsyncTestingEvent(u"mozinvisibleplaytimepaused"_ns);
|
||||
@ -432,8 +409,6 @@ void TelemetryProbesReporter::ReportResultForVideo() {
|
||||
|
||||
const double totalVideoPlayTimeS = mTotalVideoPlayTime.GetAndClearTotal();
|
||||
const double invisiblePlayTimeS = mInvisibleVideoPlayTime.GetAndClearTotal();
|
||||
const double videoDecodeSuspendTimeS =
|
||||
mVideoDecodeSuspendedTime.GetAndClearTotal();
|
||||
const double totalVideoHDRPlayTimeS =
|
||||
mTotalVideoHDRPlayTime.GetAndClearTotal();
|
||||
|
||||
@ -506,15 +481,6 @@ void TelemetryProbesReporter::ReportResultForVideo() {
|
||||
LOG("VIDEO_HIDDEN_PLAY_TIME_PERCENTAGE = %u, keys: '%s' and 'All'",
|
||||
hiddenPercentage, key.get());
|
||||
|
||||
const uint32_t videoDecodeSuspendPercentage =
|
||||
lround(videoDecodeSuspendTimeS / totalVideoPlayTimeS * 100.0);
|
||||
Telemetry::Accumulate(Telemetry::VIDEO_INFERRED_DECODE_SUSPEND_PERCENTAGE,
|
||||
key, videoDecodeSuspendPercentage);
|
||||
Telemetry::Accumulate(Telemetry::VIDEO_INFERRED_DECODE_SUSPEND_PERCENTAGE,
|
||||
"All"_ns, videoDecodeSuspendPercentage);
|
||||
LOG("VIDEO_INFERRED_DECODE_SUSPEND_PERCENTAGE = %u, keys: '%s' and 'All'",
|
||||
videoDecodeSuspendPercentage, key.get());
|
||||
|
||||
ReportResultForVideoFrameStatistics(totalVideoPlayTimeS, key);
|
||||
#ifdef MOZ_WMF_CDM
|
||||
if (mOwner->IsUsingWMFCDM()) {
|
||||
@ -654,42 +620,6 @@ void TelemetryProbesReporter::ReportResultForVideoFrameStatistics(
|
||||
return;
|
||||
}
|
||||
|
||||
FrameStatisticsData data = stats->GetFrameStatisticsData();
|
||||
if (data.mInterKeyframeCount != 0) {
|
||||
const uint32_t average_ms = uint32_t(
|
||||
std::min<uint64_t>(lround(double(data.mInterKeyframeSum_us) /
|
||||
double(data.mInterKeyframeCount) / 1000.0),
|
||||
UINT32_MAX));
|
||||
Telemetry::Accumulate(Telemetry::VIDEO_INTER_KEYFRAME_AVERAGE_MS, key,
|
||||
average_ms);
|
||||
Telemetry::Accumulate(Telemetry::VIDEO_INTER_KEYFRAME_AVERAGE_MS, "All"_ns,
|
||||
average_ms);
|
||||
LOG("VIDEO_INTER_KEYFRAME_AVERAGE_MS = %u, keys: '%s' and 'All'",
|
||||
average_ms, key.get());
|
||||
|
||||
const uint32_t max_ms = uint32_t(std::min<uint64_t>(
|
||||
(data.mInterKeyFrameMax_us + 500) / 1000, UINT32_MAX));
|
||||
Telemetry::Accumulate(Telemetry::VIDEO_INTER_KEYFRAME_MAX_MS, key, max_ms);
|
||||
Telemetry::Accumulate(Telemetry::VIDEO_INTER_KEYFRAME_MAX_MS, "All"_ns,
|
||||
max_ms);
|
||||
LOG("VIDEO_INTER_KEYFRAME_MAX_MS = %u, keys: '%s' and 'All'", max_ms,
|
||||
key.get());
|
||||
} else {
|
||||
// Here, we have played *some* of the video, but didn't get more than 1
|
||||
// keyframe. Report '0' if we have played for longer than the video-
|
||||
// decode-suspend delay (showing recovery would be difficult).
|
||||
const uint32_t suspendDelay_ms =
|
||||
StaticPrefs::media_suspend_background_video_delay_ms();
|
||||
if (uint32_t(aTotalPlayTimeS * 1000.0) > suspendDelay_ms) {
|
||||
Telemetry::Accumulate(Telemetry::VIDEO_INTER_KEYFRAME_MAX_MS, key, 0);
|
||||
Telemetry::Accumulate(Telemetry::VIDEO_INTER_KEYFRAME_MAX_MS, "All"_ns,
|
||||
0);
|
||||
LOG("VIDEO_INTER_KEYFRAME_MAX_MS = 0 (only 1 keyframe), keys: '%s' and "
|
||||
"'All'",
|
||||
key.get());
|
||||
}
|
||||
}
|
||||
|
||||
const uint64_t parsedFrames = stats->GetParsedFrames();
|
||||
if (parsedFrames) {
|
||||
const uint64_t droppedFrames = stats->GetDroppedFrames();
|
||||
@ -745,10 +675,6 @@ double TelemetryProbesReporter::GetInvisibleVideoPlayTimeInSeconds() const {
|
||||
return mInvisibleVideoPlayTime.PeekTotal();
|
||||
}
|
||||
|
||||
double TelemetryProbesReporter::GetVideoDecodeSuspendedTimeInSeconds() const {
|
||||
return mVideoDecodeSuspendedTime.PeekTotal();
|
||||
}
|
||||
|
||||
double TelemetryProbesReporter::GetTotalAudioPlayTimeInSeconds() const {
|
||||
return mTotalAudioPlayTime.PeekTotal();
|
||||
}
|
||||
|
@ -68,8 +68,6 @@ class TelemetryProbesReporter final {
|
||||
void OnAudibleChanged(AudibleState aAudible);
|
||||
void OnMediaContentChanged(MediaContent aContent);
|
||||
void OnMutedChanged(bool aMuted);
|
||||
void OnDecodeSuspended();
|
||||
void OnDecodeResumed();
|
||||
|
||||
enum class FirstFrameLoadedFlag {
|
||||
IsMSE,
|
||||
@ -89,7 +87,6 @@ class TelemetryProbesReporter final {
|
||||
double GetTotalVideoHDRPlayTimeInSeconds() const;
|
||||
double GetVisibleVideoPlayTimeInSeconds() const;
|
||||
double GetInvisibleVideoPlayTimeInSeconds() const;
|
||||
double GetVideoDecodeSuspendedTimeInSeconds() const;
|
||||
|
||||
double GetTotalAudioPlayTimeInSeconds() const;
|
||||
double GetInaudiblePlayTimeInSeconds() const;
|
||||
@ -183,9 +180,6 @@ class TelemetryProbesReporter final {
|
||||
// Total time an element with an audio track has spent muted
|
||||
TimeDurationAccumulator mMutedAudioPlayTime;
|
||||
|
||||
// Total time a VIDEO has spent in video-decode-suspend mode.
|
||||
TimeDurationAccumulator mVideoDecodeSuspendedTime;
|
||||
|
||||
Visibility mMediaElementVisibility = Visibility::eInitial;
|
||||
|
||||
MediaContent mMediaContent = MediaContent::MEDIA_HAS_NOTHING;
|
||||
|
@ -242,9 +242,6 @@ partial interface HTMLMediaElement {
|
||||
[ChromeOnly]
|
||||
readonly attribute double invisiblePlayTime;
|
||||
|
||||
[ChromeOnly]
|
||||
readonly attribute double videoDecodeSuspendedTime;
|
||||
|
||||
[ChromeOnly]
|
||||
readonly attribute double totalAudioPlayTime;
|
||||
|
||||
|
@ -13235,43 +13235,6 @@
|
||||
"bug_numbers": [1662212, 1685399],
|
||||
"releaseChannelCollection": "opt-out"
|
||||
},
|
||||
"VIDEO_INFERRED_DECODE_SUSPEND_PERCENTAGE": {
|
||||
"record_in_processes": ["main", "content"],
|
||||
"products": ["firefox"],
|
||||
"alert_emails": ["media-alerts@mozilla.com"],
|
||||
"expires_in_version": "110",
|
||||
"description": "Percentage of total time spent *not* fully decoding video while element is hidden (simulated, even when feature is not enabled). Keyed by audio presence and by height ranges (boundaries: 240. 480, 576, 720, 1080, 2160), e.g.: 'V,0<h<=240', 'AV,h>2160'; and 'All' will accumulate all percentages.",
|
||||
"keyed": true,
|
||||
"kind": "linear",
|
||||
"high": 100,
|
||||
"n_buckets": 50,
|
||||
"bug_numbers": [1293145, 1570634, 1606206, 1685399, 1714303, 1754647],
|
||||
"releaseChannelCollection": "opt-out"
|
||||
},
|
||||
"VIDEO_INTER_KEYFRAME_AVERAGE_MS": {
|
||||
"record_in_processes": ["content"],
|
||||
"products": ["firefox"],
|
||||
"alert_emails": ["media-alerts@mozilla.com"],
|
||||
"expires_in_version": "110",
|
||||
"description": "Average interval between video keyframes in played videos, in milliseconds. Keyed by audio presence and by height ranges (boundaries: 240. 480, 576, 720, 1080, 2160), e.g.: 'V,0<h<=240', 'AV,h>2160'; and 'All' will accumulate all percentages.",
|
||||
"keyed": true,
|
||||
"kind": "exponential",
|
||||
"high": 60000,
|
||||
"n_buckets": 100,
|
||||
"bug_numbers": [1289668, 1570634, 1606206, 1685399, 1754648]
|
||||
},
|
||||
"VIDEO_INTER_KEYFRAME_MAX_MS": {
|
||||
"record_in_processes": ["content"],
|
||||
"products": ["firefox"],
|
||||
"alert_emails": ["media-alerts@mozilla.com"],
|
||||
"expires_in_version": "92",
|
||||
"description": "Maximum interval between video keyframes in played videos, in milliseconds; '0' means only 1 keyframe found. Keyed by audio presence and by height ranges (boundaries: 240. 480, 576, 720, 1080, 2160), e.g.: 'V,0<h<=240', 'AV,h>2160'; and 'All' will accumulate all percentages. This is reported whenever the decoder stops. (eg. pausing media, encountering an error, changing to a new resource, page goes to the bf-cached or page gets discarded)",
|
||||
"keyed": true,
|
||||
"kind": "exponential",
|
||||
"high": 60000,
|
||||
"n_buckets": 100,
|
||||
"bug_numbers": [1289668, 1570634, 1606206, 1685399]
|
||||
},
|
||||
"VIDEO_SUSPEND_RECOVERY_TIME_MS": {
|
||||
"record_in_processes": ["content"],
|
||||
"products": ["firefox"],
|
||||
|
1
tools/@types/lib.gecko.dom.d.ts
vendored
1
tools/@types/lib.gecko.dom.d.ts
vendored
@ -10395,7 +10395,6 @@ interface HTMLMediaElement extends HTMLElement {
|
||||
readonly totalAudioPlayTime: number;
|
||||
readonly totalVideoHDRPlayTime: number;
|
||||
readonly totalVideoPlayTime: number;
|
||||
readonly videoDecodeSuspendedTime: number;
|
||||
readonly videoTracks: VideoTrackList;
|
||||
readonly visiblePlayTime: number;
|
||||
volume: number;
|
||||
|
Loading…
Reference in New Issue
Block a user