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; |