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 : 019521545132e72113a87c06cfbe562a9915522d
This commit is contained in:
Wei-Cheng Pan 2017-02-08 15:11:53 +08:00
Родитель 3dffe30808
Коммит 4c78d0812e
2 изменённых файлов: 77 добавлений и 0 удалений

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

@ -8059,10 +8059,13 @@ 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);
case ePointerDown:
case ePointerUp:
isHandlingUserInput = true;
@ -8071,6 +8074,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 +8094,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;
}

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

@ -11052,5 +11052,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."
}
}