Index: ui/latency/latency_tracker.cc |
diff --git a/ui/latency/latency_tracker.cc b/ui/latency/latency_tracker.cc |
index 06701f05d48a8cd2947722f2bb5001a93213d4d4..13f531590515be56f982b056c7b1f17ca9cab65e 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: |
+ return "Key"; |
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) { |
+ ComputeEndToEndLatencyHistograms(gpu_swap_begin_component, |
+ gpu_swap_end_component, latency); |
} |
// Compute the old scroll update latency metrics. They are exclusively |
@@ -114,7 +117,7 @@ void LatencyTracker::ReportRapporScrollLatency( |
const LatencyInfo::LatencyComponent& start_component, |
const LatencyInfo::LatencyComponent& end_component) {} |
-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) { |
@@ -165,6 +168,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 == "Key") { |
+ UMA_HISTOGRAM_INPUT_LATENCY_HIGH_RESOLUTION_MICROSECONDS( |
+ "Event.Latency.EndToEnd.Key", original_component, |
+ gpu_swap_begin_component); |
+ } |
} else { |
// No original component found. |
return; |