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

Unified Diff: ui/latency/latency_tracker.cc

Issue 2756893002: Add Keyboard Latency UMA Metrics. (Closed)
Patch Set: mfomitchev responses, rebase Created 3 years, 8 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
« ui/events/event.cc ('K') | « ui/latency/latency_tracker.h ('k') | no next file » | 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 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;
« ui/events/event.cc ('K') | « ui/latency/latency_tracker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698