Bug 1341531 - Measure input event dispatching latency. (*_EVENT_RECEIVED_MS) r=smaug

This patch measures the time from an input event creation, to it been
dispatched to PresShell, but just before any handler been executed.

MozReview-Commit-ID: 6ZYra7YYICY

--HG--
extra : rebase_source : fb864ab2ec7af3d59f4a4ccf52667f34dcd588d6
This commit is contained in:
Wei-Cheng Pan 2017-02-08 15:11:53 +08:00
Родитель 59edf19913
Коммит 60a694bdf1
2 изменённых файлов: 78 добавлений и 0 удалений

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

@ -8059,10 +8059,14 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent,
nsPresContext::InteractionType::eKeyInteraction,
aEvent->mTimeStamp);
}
Telemetry::AccumulateTimeDelta(Telemetry::KEYBOARD_EVENT_RECEIVED_MS, aEvent->mTimeStamp);
break;
}
case eMouseDown:
case eMouseUp:
Telemetry::AccumulateTimeDelta(Telemetry::MOUSE_CLICK_EVENT_RECEIVED_MS, aEvent->mTimeStamp);
MOZ_FALLTHROUGH;
case ePointerDown:
case ePointerUp:
isHandlingUserInput = true;
@ -8071,6 +8075,14 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent,
aEvent->mTimeStamp);
break;
case eMouseMove:
if (aEvent->mFlags.mHandledByAPZ) {
Telemetry::AccumulateTimeDelta(Telemetry::APZ_HANDLED_MOUSE_MOVE_EVENT_RECEIVED_MS, aEvent->mTimeStamp);
} else {
Telemetry::AccumulateTimeDelta(Telemetry::MOUSE_MOVE_EVENT_RECEIVED_MS, aEvent->mTimeStamp);
}
break;
case eDrop: {
nsCOMPtr<nsIDragSession> session = nsContentUtils::GetDragSession();
if (session) {
@ -8083,6 +8095,18 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent,
break;
}
case eWheel:
if (aEvent->mFlags.mHandledByAPZ) {
Telemetry::AccumulateTimeDelta(Telemetry::APZ_HANDLED_WHEEL_EVENT_RECEIVED_MS, aEvent->mTimeStamp);
}
break;
case eTouchMove:
if (aEvent->mFlags.mHandledByAPZ) {
Telemetry::AccumulateTimeDelta(Telemetry::APZ_HANDLED_TOUCH_MOVE_EVENT_RECEIVED_MS, aEvent->mTimeStamp);
}
break;
default:
break;
}

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

@ -11119,5 +11119,59 @@
"n_buckets": 20,
"keyed": true,
"description": "Measures the number of milliseconds we spend waiting on the main thread for IPC messages to serialize their parameters. Note: only messages that take more than 500 microseconds are included in this probe. This probe is keyed on the IPDL message name."
},
"MOUSE_MOVE_EVENT_RECEIVED_MS": {
"alert_emails": ["wpan@mozilla.com"],
"expires_in_version": "60",
"kind": "exponential",
"high": 50000,
"n_buckets": 100,
"bug_numbers": [1341531],
"description": "Time (ms) for the mouse move event to dispatch, but before handlers executing."
},
"MOUSE_CLICK_EVENT_RECEIVED_MS": {
"alert_emails": ["wpan@mozilla.com"],
"expires_in_version": "60",
"kind": "exponential",
"high": 50000,
"n_buckets": 100,
"bug_numbers": [1341531],
"description": "Time (ms) for the mouse click event to dispatch, but before handlers executing."
},
"KEYBOARD_EVENT_RECEIVED_MS": {
"alert_emails": ["wpan@mozilla.com"],
"expires_in_version": "60",
"kind": "exponential",
"high": 50000,
"n_buckets": 100,
"bug_numbers": [1341531],
"description": "Time (ms) for the keyboard event to dispatch, but before handlers executing."
},
"APZ_HANDLED_TOUCH_MOVE_EVENT_RECEIVED_MS": {
"alert_emails": ["wpan@mozilla.com"],
"expires_in_version": "60",
"kind": "exponential",
"high": 50000,
"n_buckets": 100,
"bug_numbers": [1341531],
"description": "Time (ms) for the APZ handled touch move event to dispatch, but before handlers executing."
},
"APZ_HANDLED_MOUSE_MOVE_EVENT_RECEIVED_MS": {
"alert_emails": ["wpan@mozilla.com"],
"expires_in_version": "60",
"kind": "exponential",
"high": 50000,
"n_buckets": 100,
"bug_numbers": [1341531],
"description": "Time (ms) for the APZ handled mouse move event to dispatch, but before handlers executing."
},
"APZ_HANDLED_WHEEL_EVENT_RECEIVED_MS": {
"alert_emails": ["wpan@mozilla.com"],
"expires_in_version": "60",
"kind": "exponential",
"high": 50000,
"n_buckets": 100,
"bug_numbers": [1341531],
"description": "Time (ms) for the APZ handled wheel event to dispatch, but before handlers executing."
}
}