Bug 1230265 - Add VP9 benchmark telemetry; r?bsmedberg
MozReview-Commit-ID: 6ofvNqvkg0U
--- a/dom/media/Benchmark.cpp
+++ b/dom/media/Benchmark.cpp
@@ -6,16 +6,17 @@
#include "Benchmark.h"
#include "DecoderTraits.h"
#include "PDMFactory.h"
#include "WebMDemuxer.h"
#include "BufferMediaResource.h"
#include "WebMSample.h"
#include "mozilla/Preferences.h"
+#include "mozilla/Telemetry.h"
namespace mozilla {
const char* Benchmark::sBenchmarkFpsPref = "media.benchmark.fps";
bool Benchmark::sHasRunTest = false;
const uint32_t BenchmarkDecoder::sStartupFrames = 1;
@@ -56,16 +57,17 @@ Benchmark::Benchmark()
}
void
Benchmark::SaveResult(uint32_t aDecodeFps)
{
MOZ_ASSERT(NS_IsMainThread());
Preferences::SetUint(sBenchmarkFpsPref, aDecodeFps);
+ Telemetry::Accumulate(Telemetry::ID::VIDEO_VP9_BENCHMARK_FPS, aDecodeFps);
}
void
Benchmark::Drain(RefPtr<MediaDataDecoder> aDecoder)
{
RefPtr<Benchmark> self = this;
mPlaybackState.Dispatch(NS_NewRunnableFunction([self, aDecoder]() {
self->mPlaybackState.Drain(aDecoder);
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -8691,16 +8691,26 @@
"VIDEO_OPENH264_GMP_MISSING_FILES": {
"alert_emails": ["cpearce@mozilla.com", "rjesup@mozilla.com"],
"expires_in_version": "50",
"kind": "enumerated",
"n_values" : 4,
"description": "OpenH264 GMP files missing (0=none, or sum of: 1=library, 2=info)",
"releaseChannelCollection": "opt-out"
},
+ "VIDEO_VP9_BENCHMARK_FPS": {
+ "alert_emails": ["ajones@mozilla.com"],
+ "expires_in_version": "50",
+ "bug_numbers": [1230265],
+ "kind": "linear",
+ "high": 1000,
+ "n_buckets": 100,
+ "description": "720p VP9 decode benchmark measurement in frames per second",
+ "releaseChannelCollection": "opt-out"
+ },
"MEDIA_CODEC_USED": {
"alert_emails": ["cpearce@mozilla.com"],
"expires_in_version": "never",
"keyed": true,
"kind": "count",
"description": "Count of use of audio/video codecs in HTMLMediaElements and WebAudio. Those with 'resource' prefix are approximate; report based on HTTP ContentType or sniffing. Those with 'webaudio' prefix are for WebAudio."
},
"FX_SANITIZE_TOTAL": {