Bug 1100920 - telemetry probe for frames latency. r=roc
authorAvi Halachmi <avihpit@yahoo.com>
Tue, 18 Nov 2014 14:47:32 +0200
changeset 216684 163a9cee54368cb51dc395783518b6ca0c42f55c
parent 216683 0ee7bf79625eebbf1cf21b9620620d1f5bdda8a2
child 216685 f39fc9dc4c0d8a3565116a1b4e6852f80f9a397c
push id27858
push userkwierso@gmail.com
push dateFri, 21 Nov 2014 01:35:46 +0000
treeherdermozilla-central@6309710dd71d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1100920
milestone36.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 1100920 - telemetry probe for frames latency. r=roc
layout/base/nsRefreshDriver.cpp
toolkit/components/telemetry/Histograms.json
--- a/layout/base/nsRefreshDriver.cpp
+++ b/layout/base/nsRefreshDriver.cpp
@@ -46,16 +46,18 @@
 #include "RestyleManager.h"
 #include "Layers.h"
 #include "imgIContainer.h"
 #include "nsIFrameRequestCallback.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "nsDocShell.h"
 #include "nsISimpleEnumerator.h"
 
+#include "mozilla/Telemetry.h"
+
 using namespace mozilla;
 using namespace mozilla::widget;
 
 #ifdef PR_LOGGING
 static PRLogModuleInfo *gLog = nullptr;
 #define LOG(...) PR_LOG(gLog, PR_LOG_NOTICE, (__VA_ARGS__))
 #else
 #define LOG(...) do { } while(0)
@@ -291,16 +293,17 @@ protected:
     }
 #endif
 
     // log info & lateness
     LOG("[%p] precise timer last tick late by %f ms, next tick in %d ms",
         this,
         (aNowTime - mTargetTime).ToMilliseconds(),
         delay);
+    Telemetry::Accumulate(Telemetry::FX_REFRESH_DRIVER_FRAME_DELAY_MS, (aNowTime - mTargetTime).ToMilliseconds());
 
     // then schedule the timer
     LOG("[%p] scheduling callback for %d ms (2)", this, delay);
     mTimer->InitWithFuncCallback(TimerTick, this, delay, nsITimer::TYPE_ONE_SHOT);
 
     mTargetTime = newTarget;
   }
 };
@@ -405,16 +408,17 @@ protected:
     // Make sure the delay is never negative.
     uint32_t delay = static_cast<uint32_t>(delayMs < 0 ? 0 : delayMs);
 
     // log info & lateness
     LOG("[%p] precise dwm-vsync timer last tick late by %f ms, next tick in %d ms",
         this,
         (aNowTime - mTargetTime).ToMilliseconds(),
         delay);
+    Telemetry::Accumulate(Telemetry::FX_REFRESH_DRIVER_FRAME_DELAY_MS, (aNowTime - mTargetTime).ToMilliseconds());
 
     // then schedule the timer
     LOG("[%p] scheduling callback for %d ms (2)", this, delay);
     mTimer->InitWithFuncCallback(TimerTick, this, delay, nsITimer::TYPE_ONE_SHOT);
 
     mTargetTime = newTarget;
   }
 };
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -3507,16 +3507,23 @@
   },
   "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)"
   },
+  "FX_REFRESH_DRIVER_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"
+  },
   "FX_TAB_SWITCH_UPDATE_MS": {
     "alert_emails": ["perf-telemetry-alerts@mozilla.com"],
     "expires_in_version": "40",
     "kind": "exponential",
     "high": "1000",
     "n_buckets": 20,
     "description": "Firefox: Time in ms spent updating UI in response to a tab switch"
   },