Bug 1228147: part 2: Add telemetry probe for synchronous scroll. r=kats

This commit is contained in:
Avi Halachmi 2015-12-16 17:18:45 +02:00
parent 3fd87c8d33
commit 9eb1965ef0
4 changed files with 29 additions and 3 deletions

View File

@ -441,8 +441,11 @@ private:
#ifndef ANDROID /* bug 1142079 */
if (XRE_IsParentProcess()) {
TimeDuration vsyncLatency = TimeStamp::Now() - aVsyncTimestamp;
uint32_t sample = (uint32_t)vsyncLatency.ToMilliseconds();
Telemetry::Accumulate(Telemetry::FX_REFRESH_DRIVER_CHROME_FRAME_DELAY_MS,
vsyncLatency.ToMilliseconds());
sample);
Telemetry::Accumulate(Telemetry::FX_REFRESH_DRIVER_SYNC_SCROLL_FRAME_DELAY_MS,
sample);
} else if (mVsyncRate != TimeDuration::Forever()) {
TimeDuration contentDelay = (TimeStamp::Now() - mLastChildTick) - mVsyncRate;
if (contentDelay.ToMilliseconds() < 0 ){
@ -450,8 +453,11 @@ private:
// the reported hardware rate. In those cases, consider that we have 0 delay.
contentDelay = TimeDuration::FromMilliseconds(0);
}
uint32_t sample = (uint32_t)contentDelay.ToMilliseconds();
Telemetry::Accumulate(Telemetry::FX_REFRESH_DRIVER_CONTENT_FRAME_DELAY_MS,
contentDelay.ToMilliseconds());
sample);
Telemetry::Accumulate(Telemetry::FX_REFRESH_DRIVER_SYNC_SCROLL_FRAME_DELAY_MS,
sample);
} else {
// Request the vsync rate from the parent process. Might be a few vsyncs
// until the parent responds.

View File

@ -41,6 +41,7 @@
#include "mozilla/dom/Element.h"
#include <stdint.h>
#include "mozilla/MathAlgorithms.h"
#include "mozilla/Telemetry.h"
#include "FrameLayerBuilder.h"
#include "nsSMILKeySpline.h"
#include "nsSubDocumentFrame.h"
@ -1510,6 +1511,8 @@ public:
, mCallee(nullptr)
, mOneDevicePixelInAppUnits(aPresContext->DevPixelsToAppUnits(1))
{
Telemetry::SetHistogramRecordingEnabled(
Telemetry::FX_REFRESH_DRIVER_SYNC_SCROLL_FRAME_DELAY_MS, true);
}
NS_INLINE_DECL_REFCOUNTING(AsyncSmoothMSDScroll, override)
@ -1598,6 +1601,8 @@ private:
// Private destructor, to discourage deletion outside of Release():
~AsyncSmoothMSDScroll() {
RemoveObserver();
Telemetry::SetHistogramRecordingEnabled(
Telemetry::FX_REFRESH_DRIVER_SYNC_SCROLL_FRAME_DELAY_MS, false);
}
nsRefreshDriver* RefreshDriver(ScrollFrameHelper* aCallee) {
@ -1634,12 +1639,17 @@ public:
explicit AsyncScroll(nsPoint aStartPos)
: AsyncScrollBase(aStartPos)
, mCallee(nullptr)
{}
{
Telemetry::SetHistogramRecordingEnabled(
Telemetry::FX_REFRESH_DRIVER_SYNC_SCROLL_FRAME_DELAY_MS, true);
}
private:
// Private destructor, to discourage deletion outside of Release():
~AsyncScroll() {
RemoveObserver();
Telemetry::SetHistogramRecordingEnabled(
Telemetry::FX_REFRESH_DRIVER_SYNC_SCROLL_FRAME_DELAY_MS, false);
}
public:

View File

@ -4135,6 +4135,15 @@
"bug_numbers": [1221674],
"description": "Delay in ms between the target and the actual handling time of the frame at refresh driver in the content process."
},
"FX_REFRESH_DRIVER_SYNC_SCROLL_FRAME_DELAY_MS": {
"alert_emails": ["perf-telemetry-alerts@mozilla.com"],
"expires_in_version": "never",
"kind": "exponential",
"high": "10000",
"n_buckets": 50,
"bug_numbers": [1228147],
"description": "Delay in ms between the target and the actual handling time of the frame at refresh driver while scrolling synchronously."
},
"FX_TAB_SWITCH_UPDATE_MS": {
"alert_emails": ["perf-telemetry-alerts@mozilla.com"],
"expires_in_version": "never",

View File

@ -909,6 +909,7 @@ IsHistogramEnumId(Telemetry::ID aID)
// List of histogram IDs which should have recording disabled initially.
const Telemetry::ID kRecordingInitiallyDisabledIDs[] = {
Telemetry::FX_REFRESH_DRIVER_SYNC_SCROLL_FRAME_DELAY_MS,
// The array must not be empty. Leave these item here.
Telemetry::TELEMETRY_TEST_COUNT_INIT_NO_RECORD,