Bug 1220699 - Add telemetry probe to measure vsync latency in the refresh driver in chrome process. r=avih, a=sylvestre
authorMason Chang <mchang@mozilla.com>
Wed, 04 Nov 2015 10:07:00 +0100
changeset 296662 d681ec6fe6b2
parent 296661 1692a311615d
child 296663 cd32550ec7fe
push id5277
push usercbook@mozilla.com
push date2015-11-09 10:34 +0000
treeherdermozilla-beta@d681ec6fe6b2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersavih, sylvestre
bugs1220699
milestone43.0
Bug 1220699 - Add telemetry probe to measure vsync latency in the refresh driver in chrome process. r=avih, a=sylvestre
layout/base/nsRefreshDriver.cpp
toolkit/components/telemetry/Histograms.json
--- a/layout/base/nsRefreshDriver.cpp
+++ b/layout/base/nsRefreshDriver.cpp
@@ -356,16 +356,21 @@ private:
     virtual ~RefreshDriverVsyncObserver() {}
 
     void TickRefreshDriver(TimeStamp aVsyncTimestamp)
     {
       MOZ_ASSERT(NS_IsMainThread());
 
       if (XRE_IsParentProcess()) {
         MonitorAutoLock lock(mRefreshTickLock);
+        #ifndef ANDROID  /* bug 1142079 */
+          TimeDuration vsyncLatency = TimeStamp::Now() - aVsyncTimestamp;
+          Telemetry::Accumulate(Telemetry::FX_REFRESH_DRIVER_CHROME_FRAME_DELAY_MS,
+          vsyncLatency.ToMilliseconds());
+        #endif
         aVsyncTimestamp = mRecentVsync;
         mProcessedVsync = true;
       }
       MOZ_ASSERT(aVsyncTimestamp <= TimeStamp::Now());
 
       // We might have a problem that we call ~VsyncRefreshDriverTimer() before
       // the scheduled TickRefreshDriver() runs. Check mVsyncRefreshDriverTimer
       // before use.
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -4051,22 +4051,22 @@
   },
   "FX_TAB_ANIM_ANY_FRAME_PAINT_MS": {
     "expires_in_version": "40",
     "kind": "exponential",
     "high": "500",
     "n_buckets": 30,
     "description": "Average paint duration during any tab open/close animation (excluding tabstrip scroll) *** No longer needed (bug 1156565). Delete histogram and accumulation code! ***"
   },
-  "FX_REFRESH_DRIVER_FRAME_DELAY_MS": {
+  "FX_REFRESH_DRIVER_CHROME_FRAME_DELAY_MS": {
     "expires_in_version": "default",
     "kind": "exponential",
     "high": "10000",
     "n_buckets": 50,
-    "description": "Delay in ms between the target and the actual handling time of the frame at refresh driver"
+    "description": "Delay in ms between the target and the actual handling time of the frame at refresh driver in chrome process."
   },
   "FX_TAB_SWITCH_UPDATE_MS": {
     "alert_emails": ["perf-telemetry-alerts@mozilla.com"],
     "expires_in_version": "never",
     "kind": "exponential",
     "high": "1000",
     "n_buckets": 20,
     "description": "Firefox: Time in ms spent updating UI in response to a tab switch"