| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/latency/latency_tracker.h" | 5 #include "ui/latency/latency_tracker.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram_functions.h" | 7 #include "base/metrics/histogram_functions.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "ui/latency/latency_histogram_macros.h" | 9 #include "ui/latency/latency_histogram_macros.h" |
| 10 | 10 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 } | 113 } |
| 114 | 114 |
| 115 void LatencyTracker::ReportRapporScrollLatency( | 115 void LatencyTracker::ReportRapporScrollLatency( |
| 116 const std::string& name, | 116 const std::string& name, |
| 117 const LatencyInfo::LatencyComponent& start_component, | 117 const LatencyInfo::LatencyComponent& start_component, |
| 118 const LatencyInfo::LatencyComponent& end_component) { | 118 const LatencyInfo::LatencyComponent& end_component) { |
| 119 // TODO(mfomitchev): crbug.com/717629: Make RAPPOR or UKM reporting work with | 119 // TODO(mfomitchev): crbug.com/717629: Make RAPPOR or UKM reporting work with |
| 120 // Mus. | 120 // Mus. |
| 121 } | 121 } |
| 122 | 122 |
| 123 void LatencyTracker::ReportUkmScrollLatency( |
| 124 const std::string& name, |
| 125 const LatencyInfo::LatencyComponent& start_component, |
| 126 const LatencyInfo::LatencyComponent& end_component) { |
| 127 // TODO(mfomitchev): crbug.com/717629: Make RAPPOR or UKM reporting work with |
| 128 // Mus. |
| 129 } |
| 130 |
| 123 void LatencyTracker::ComputeEndToEndLatencyHistograms( | 131 void LatencyTracker::ComputeEndToEndLatencyHistograms( |
| 124 const ui::LatencyInfo::LatencyComponent& gpu_swap_begin_component, | 132 const ui::LatencyInfo::LatencyComponent& gpu_swap_begin_component, |
| 125 const ui::LatencyInfo::LatencyComponent& gpu_swap_end_component, | 133 const ui::LatencyInfo::LatencyComponent& gpu_swap_end_component, |
| 126 const ui::LatencyInfo& latency) { | 134 const ui::LatencyInfo& latency) { |
| 127 DCHECK(!latency.coalesced()); | 135 DCHECK(!latency.coalesced()); |
| 128 if (latency.coalesced()) | 136 if (latency.coalesced()) |
| 129 return; | 137 return; |
| 130 | 138 |
| 131 LatencyInfo::LatencyComponent original_component; | 139 LatencyInfo::LatencyComponent original_component; |
| 132 std::string scroll_name = "ScrollUpdate"; | 140 std::string scroll_name = "ScrollUpdate"; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 163 // created to when the scroll gesture results in final frame swap. | 171 // created to when the scroll gesture results in final frame swap. |
| 164 // First scroll events are excluded from this metric. | 172 // First scroll events are excluded from this metric. |
| 165 if (input_modality == "Touch") { | 173 if (input_modality == "Touch") { |
| 166 UMA_HISTOGRAM_INPUT_LATENCY_HIGH_RESOLUTION_MICROSECONDS( | 174 UMA_HISTOGRAM_INPUT_LATENCY_HIGH_RESOLUTION_MICROSECONDS( |
| 167 "Event.Latency.ScrollUpdate.Touch.TimeToScrollUpdateSwapBegin2", | 175 "Event.Latency.ScrollUpdate.Touch.TimeToScrollUpdateSwapBegin2", |
| 168 original_component, gpu_swap_begin_component); | 176 original_component, gpu_swap_begin_component); |
| 169 | 177 |
| 170 ReportRapporScrollLatency( | 178 ReportRapporScrollLatency( |
| 171 "Event.Latency.ScrollUpdate.Touch.TimeToScrollUpdateSwapBegin2", | 179 "Event.Latency.ScrollUpdate.Touch.TimeToScrollUpdateSwapBegin2", |
| 172 original_component, gpu_swap_begin_component); | 180 original_component, gpu_swap_begin_component); |
| 181 ReportUkmScrollLatency( |
| 182 "Event.Latency.ScrollUpdate.Touch.TimeToScrollUpdateSwapBegin2", |
| 183 original_component, gpu_swap_begin_component); |
| 173 } | 184 } |
| 174 } else if (latency.FindLatency(ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, | 185 } else if (latency.FindLatency(ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, |
| 175 &original_component)) { | 186 &original_component)) { |
| 176 if (input_modality == "KeyPress") { | 187 if (input_modality == "KeyPress") { |
| 177 UMA_HISTOGRAM_INPUT_LATENCY_HIGH_RESOLUTION_MICROSECONDS( | 188 UMA_HISTOGRAM_INPUT_LATENCY_HIGH_RESOLUTION_MICROSECONDS( |
| 178 "Event.Latency.EndToEnd.KeyPress", original_component, | 189 "Event.Latency.EndToEnd.KeyPress", original_component, |
| 179 gpu_swap_begin_component); | 190 gpu_swap_begin_component); |
| 180 } | 191 } |
| 181 } else { | 192 } else { |
| 182 // No original component found. | 193 // No original component found. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 "Event.Latency." + scroll_name + "." + input_modality + | 236 "Event.Latency." + scroll_name + "." + input_modality + |
| 226 ".BrowserNotifiedToBeforeGpuSwap2", | 237 ".BrowserNotifiedToBeforeGpuSwap2", |
| 227 browser_received_swap_component, gpu_swap_begin_component); | 238 browser_received_swap_component, gpu_swap_begin_component); |
| 228 | 239 |
| 229 UMA_HISTOGRAM_SCROLL_LATENCY_SHORT_2( | 240 UMA_HISTOGRAM_SCROLL_LATENCY_SHORT_2( |
| 230 "Event.Latency." + scroll_name + "." + input_modality + ".GpuSwap2", | 241 "Event.Latency." + scroll_name + "." + input_modality + ".GpuSwap2", |
| 231 gpu_swap_begin_component, gpu_swap_end_component); | 242 gpu_swap_begin_component, gpu_swap_end_component); |
| 232 } | 243 } |
| 233 | 244 |
| 234 } // namespace ui | 245 } // namespace ui |
| OLD | NEW |