diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp index 5de68a374f49..fea8c8a4cb44 100644 --- a/layout/base/nsRefreshDriver.cpp +++ b/layout/base/nsRefreshDriver.cpp @@ -51,6 +51,8 @@ #include "nsDocShell.h" #include "nsISimpleEnumerator.h" +#include "mozilla/Telemetry.h" + using namespace mozilla; using namespace mozilla::widget; @@ -296,6 +298,7 @@ protected: 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); @@ -410,6 +413,7 @@ protected: 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); diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 678a2fe3ce84..519fbef558d8 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -3512,6 +3512,13 @@ "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",