Bug 1506537 - Part 2: Add telemetry probe for keypress presentation latency. r=smaug
authorBas Schouten <bschouten@mozilla.com>
Thu, 13 Dec 2018 03:33:56 +0100
changeset 509998 7462040e3c09e82a38b700bd48997dd5babe4d26
parent 509997 e254270c043d92c273e7b5f8bf860aa14e45b432
child 509999 2bd9efc392886fd31f0925e8163fcdd160f24113
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1506537
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1506537 - Part 2: Add telemetry probe for keypress presentation latency. r=smaug
gfx/layers/Layers.cpp
toolkit/components/telemetry/Histograms.json
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -162,16 +162,22 @@ void LayerManager::PayloadPresented() {
       if (profiler_is_active()) {
         nsPrintfCString marker(
             "Payload Presented, type: %d latency: %dms\n",
             int32_t(payload.mType),
             int32_t((presented - payload.mTimeStamp).ToMilliseconds()));
         profiler_add_marker(marker.get());
       }
 #endif
+
+      if (payload.mType == CompositionPayloadType::eKeyPress) {
+        Telemetry::AccumulateTimeDelta(
+            mozilla::Telemetry::KEYPRESS_PRESENT_LATENCY, payload.mTimeStamp,
+            presented);
+      }
     }
   }
 }
 
 //--------------------------------------------------
 // Layer
 
 Layer::Layer(LayerManager* aManager, void* aImplData)
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -1433,16 +1433,28 @@
   "IMAGE_REQUEST_DISPATCHED": {
     "record_in_processes": ["main", "content"],
     "alert_emails": ["gfx-telemetry-alerts@mozilla.com","aosmond@mozilla.com"],
     "expires_in_version": "62",
     "kind": "boolean",
     "description": "Track how many image requests required event dispatching because we were unable to predict the correct scheduler group: true if the request required dispatching. See image/imgRequestProxy.cpp for details.",
     "bug_numbers": [1359833]
   },
+  "KEYPRESS_PRESENT_LATENCY": {
+    "record_in_processes": [ "all" ],
+    "alert_emails": [ "perfteam@mozilla.com", "vchin@mozilla.com" ],
+    "expires_in_version": "never",
+    "kind": "exponential",
+    "releaseChannelCollection": "opt-out",
+    "low": 1,
+    "high": 200000,
+    "n_buckets": 50,
+    "description": "Time between receiving a keypress event on the event loop and compositing its result onto the screen (ms)",
+    "bug_numbers": [ 1506537 ]
+  },
   "CANVAS_2D_USED": {
     "record_in_processes": ["main", "content"],
     "expires_in_version": "never",
     "kind": "boolean",
     "description": "2D canvas used"
   },
   "CANVAS_WEBGL_ACCL_FAILURE_ID": {
     "record_in_processes": ["main", "content", "gpu"],