Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Unified Diff: ui/latency/latency_tracker.cc

Issue 2756893002: Add Keyboard Latency UMA Metrics. (Closed)
Patch Set: Restrict to RawKeyDown and Char events on Android & Mac Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/latency/latency_tracker.h ('k') | ui/latency/mojo/latency_info.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/latency/latency_tracker.cc
diff --git a/ui/latency/latency_tracker.cc b/ui/latency/latency_tracker.cc
index 20a30f1285e75ef592ea60d43c576f6afa2a1970..d402506dcf645450b38a47f5a8d76a6935d20adc 100644
--- a/ui/latency/latency_tracker.cc
+++ b/ui/latency/latency_tracker.cc
@@ -18,6 +18,8 @@ std::string LatencySourceEventTypeToInputModalityString(
return "Wheel";
case ui::SourceEventType::TOUCH:
return "Touch";
+ case ui::SourceEventType::KEY_PRESS:
+ return "KeyPress";
default:
return "";
}
@@ -92,9 +94,10 @@ void LatencyTracker::OnGpuSwapBuffersCompleted(const LatencyInfo& latency) {
ui::SourceEventType source_event_type = latency.source_event_type();
if (source_event_type == ui::SourceEventType::WHEEL ||
- source_event_type == ui::SourceEventType::TOUCH) {
- ComputeTouchAndWheelScrollLatencyHistograms(
- gpu_swap_begin_component, gpu_swap_end_component, latency);
+ source_event_type == ui::SourceEventType::TOUCH ||
+ source_event_type == ui::SourceEventType::KEY_PRESS) {
+ ComputeEndToEndLatencyHistograms(gpu_swap_begin_component,
+ gpu_swap_end_component, latency);
}
// Compute the old scroll update latency metrics. They are exclusively
@@ -117,7 +120,7 @@ void LatencyTracker::ReportRapporScrollLatency(
// Mus.
}
-void LatencyTracker::ComputeTouchAndWheelScrollLatencyHistograms(
+void LatencyTracker::ComputeEndToEndLatencyHistograms(
const ui::LatencyInfo::LatencyComponent& gpu_swap_begin_component,
const ui::LatencyInfo::LatencyComponent& gpu_swap_end_component,
const ui::LatencyInfo& latency) {
@@ -168,6 +171,13 @@ void LatencyTracker::ComputeTouchAndWheelScrollLatencyHistograms(
"Event.Latency.ScrollUpdate.Touch.TimeToScrollUpdateSwapBegin2",
original_component, gpu_swap_begin_component);
}
+ } else if (latency.FindLatency(ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0,
+ &original_component)) {
+ if (input_modality == "KeyPress") {
+ UMA_HISTOGRAM_INPUT_LATENCY_HIGH_RESOLUTION_MICROSECONDS(
+ "Event.Latency.EndToEnd.KeyPress", original_component,
+ gpu_swap_begin_component);
+ }
} else {
// No original component found.
return;
« no previous file with comments | « ui/latency/latency_tracker.h ('k') | ui/latency/mojo/latency_info.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698