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

This commit is contained in:
Avi Halachmi 2015-12-16 20:06:40 +02:00
Родитель 6984fc0759
Коммит 9b56ccfb99
4 изменённых файлов: 29 добавлений и 3 удалений

Просмотреть файл

@ -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.

Просмотреть файл

@ -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:

Просмотреть файл

@ -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",

Просмотреть файл

@ -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,