Bug 1230265 - Add VP9 benchmark telemetry; r?bsmedberg draft
authorAnthony Jones <ajones@mozilla.com>
Thu, 03 Mar 2016 16:23:19 +1300
changeset 337577 82d4ac602e70dae67aa6b92141d3c339bac6a101
parent 337576 b4582d0ef98897f3718b86ca87c77d3184e2425f
child 337578 ccbf8bd399dc58837a8400046376ff03b2912fae
push id12403
push userbmo:jyavenard@mozilla.com
push dateTue, 08 Mar 2016 02:33:43 +0000
reviewersbsmedberg
bugs1230265
milestone47.0a1
Bug 1230265 - Add VP9 benchmark telemetry; r?bsmedberg MozReview-Commit-ID: 6ofvNqvkg0U
dom/media/Benchmark.cpp
toolkit/components/telemetry/Histograms.json
--- 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": {