Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_latency_tracker.cc |
| diff --git a/content/browser/renderer_host/render_widget_host_latency_tracker.cc b/content/browser/renderer_host/render_widget_host_latency_tracker.cc |
| index 2d738c491910c4d429709da26d4ecd6193f9105b..3c3f92831fc6309d108ec07bcb80d2cfb9d9096b 100644 |
| --- a/content/browser/renderer_host/render_widget_host_latency_tracker.cc |
| +++ b/content/browser/renderer_host/render_widget_host_latency_tracker.cc |
| @@ -171,6 +171,97 @@ void ComputeScrollLatencyHistograms( |
| .InMicroseconds(), |
| 1, 1000000, 100); |
| } |
| + |
| + typedef std::pair<LatencyInfo::LatencyComponent, bool> ComponentPair; |
| + |
| + ComponentPair rendering_scheduled_main_component; |
| + ComponentPair rendering_scheduled_impl_component; |
| + ComponentPair renderer_swap_component; |
|
jdduke (slow)
2015/02/11 23:22:02
Do these always go together? If not, can we early
Yufeng Shen (Slow to review)
2015/02/12 02:59:02
CHECK seems too restrict here. I will just do earl
|
| + ComponentPair browser_received_swap_component; |
| + ComponentPair gpu_swap_component; |
| + |
| + rendering_scheduled_main_component.second = |
| + latency.FindLatency( |
| + ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN_COMPONENT, |
| + 0, &(rendering_scheduled_main_component.first)); |
| + |
| + rendering_scheduled_impl_component.second = |
| + latency.FindLatency( |
| + ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL_COMPONENT, |
| + 0, &(rendering_scheduled_impl_component.first)); |
| + |
| + renderer_swap_component.second = |
| + latency.FindLatency(ui::INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT, |
| + 0, &(renderer_swap_component.first)); |
| + |
| + browser_received_swap_component.second = |
| + latency.FindLatency( |
| + ui::INPUT_EVENT_BROWSER_RECEIVED_RENDERER_SWAP_COMPONENT, |
| + 0, &(browser_received_swap_component.first)); |
| + |
| + gpu_swap_component.second = |
| + latency.FindLatency(ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, |
| + 0, &(gpu_swap_component.first)); |
| + |
| + if (rendering_scheduled_main_component.second) { |
| + UMA_HISTOGRAM_CUSTOM_COUNTS( |
| + "Event.Latency.ScrollUpdateTouchToHandledMain", |
| + (rendering_scheduled_main_component.first.event_time - |
| + original_component.event_time).InMicroseconds(), |
| + 1, 1000000, 100); |
| + } |
| + |
| + if (rendering_scheduled_impl_component.second) { |
| + UMA_HISTOGRAM_CUSTOM_COUNTS( |
| + "Event.Latency.ScrollUpdateTouchToHandledImpl", |
| + (rendering_scheduled_impl_component.first.event_time - |
| + original_component.event_time).InMicroseconds(), |
| + 1, 1000000, 100); |
| + } |
| + |
| + if (renderer_swap_component.second) { |
| + if (rendering_scheduled_main_component.second) { |
| + UMA_HISTOGRAM_CUSTOM_COUNTS( |
| + "Event.Latency.ScrollUpdateHandledMainToRendererSwap", |
| + (renderer_swap_component.first.event_time - |
| + rendering_scheduled_main_component.first.event_time). |
| + InMicroseconds(), |
| + 1, 1000000, 100); |
| + } |
| + |
| + if (rendering_scheduled_impl_component.second) { |
| + UMA_HISTOGRAM_CUSTOM_COUNTS( |
| + "Event.Latency.ScrollUpdateHandledImplToRendererSwap", |
| + (renderer_swap_component.first.event_time - |
| + rendering_scheduled_impl_component.first.event_time). |
| + InMicroseconds(), |
| + 1, 1000000, 100); |
| + } |
| + |
| + if (browser_received_swap_component.second) { |
| + UMA_HISTOGRAM_CUSTOM_COUNTS( |
| + "Event.Latency.ScrollUpdateRendererSwapToBrowserNotified", |
| + (browser_received_swap_component.first.event_time - |
| + renderer_swap_component.first.event_time).InMicroseconds(), |
| + 1, 1000000, 100); |
| + } |
| + } |
| + |
| + if (gpu_swap_component.second) { |
| + if (browser_received_swap_component.second) { |
| + UMA_HISTOGRAM_CUSTOM_COUNTS( |
| + "Event.Latency.ScrollUpdateBrowserNotifiedToBeforeGpuSwap", |
| + (gpu_swap_component.first.event_time - |
| + browser_received_swap_component.first.event_time).InMicroseconds(), |
| + 1, 1000000, 100); |
| + } |
| + |
| + UMA_HISTOGRAM_CUSTOM_COUNTS( |
| + "Event.Latency.ScrollUpdateGpuSwap", |
| + (swap_component.event_time - |
| + gpu_swap_component.first.event_time).InMicroseconds(), |
| + 1, 1000000, 100); |
| + } |
| } |
| // LatencyComponents generated in the renderer must have component IDs |
| @@ -264,7 +355,9 @@ void RenderWidgetHostLatencyTracker::OnInputEventAck( |
| // Latency ends when it is acked but does not cause render scheduling. |
| bool rendering_scheduled = latency->FindLatency( |
| - ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT, 0, NULL); |
| + ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN_COMPONENT, 0, nullptr); |
| + rendering_scheduled |= latency->FindLatency( |
| + ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL_COMPONENT, 0, nullptr); |
| if (WebInputEvent::isGestureEventType(event.type)) { |
| if (!rendering_scheduled) { |