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..d248648e2ecda151ffd39ef224945eff2c5123ed 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,69 @@ void ComputeScrollLatencyHistograms( |
| .InMicroseconds(), |
| 1, 1000000, 100); |
| } |
| + |
| + LatencyInfo::LatencyComponent rendering_scheduled_component; |
| + bool rendering_scheduled_on_main = latency.FindLatency( |
| + ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN_COMPONENT, |
| + 0, &rendering_scheduled_component); |
| + |
| + if (!rendering_scheduled_on_main) { |
| + if (!latency.FindLatency( |
| + ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL_COMPONENT, |
| + 0, &rendering_scheduled_component)) |
| + return; |
| + } |
| + |
| + UMA_HISTOGRAM_CUSTOM_COUNTS( |
| + rendering_scheduled_on_main ? |
|
Alexei Svitkine (slow)
2015/02/12 15:31:32
This is not valid to do.
Histogram macros cache t
Yufeng Shen (Slow to review)
2015/02/12 21:33:25
Thanks for pointing this out.
|
| + "Event.Latency.ScrollUpdateTouchToHandledMain" : |
| + "Event.Latency.ScrollUpdateTouchToHandledImpl", |
| + (rendering_scheduled_component.event_time - |
| + original_component.event_time).InMicroseconds(), |
| + 1, 1000000, 100); |
| + |
| + LatencyInfo::LatencyComponent renderer_swap_component; |
| + if (!latency.FindLatency(ui::INPUT_EVENT_LATENCY_RENDERER_SWAP_COMPONENT, |
| + 0, &renderer_swap_component)) |
| + return; |
| + |
| + UMA_HISTOGRAM_CUSTOM_COUNTS( |
| + rendering_scheduled_on_main ? |
| + "Event.Latency.ScrollUpdateHandledMainToRendererSwap" : |
| + "Event.Latency.ScrollUpdateHandledImplToRendererSwap", |
| + (renderer_swap_component.event_time - |
| + rendering_scheduled_component.event_time). |
| + InMicroseconds(), |
| + 1, 1000000, 100); |
| + |
| + LatencyInfo::LatencyComponent browser_received_swap_component; |
| + if (!latency.FindLatency( |
| + ui::INPUT_EVENT_BROWSER_RECEIVED_RENDERER_SWAP_COMPONENT, |
| + 0, &browser_received_swap_component)) |
| + return; |
| + |
| + UMA_HISTOGRAM_CUSTOM_COUNTS( |
| + "Event.Latency.ScrollUpdateRendererSwapToBrowserNotified", |
| + (browser_received_swap_component.event_time - |
| + renderer_swap_component.event_time).InMicroseconds(), |
| + 1, 1000000, 100); |
| + |
| + LatencyInfo::LatencyComponent gpu_swap_component; |
| + if (!latency.FindLatency(ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, |
| + 0, &gpu_swap_component)) |
| + return; |
| + |
| + UMA_HISTOGRAM_CUSTOM_COUNTS( |
| + "Event.Latency.ScrollUpdateBrowserNotifiedToBeforeGpuSwap", |
| + (gpu_swap_component.event_time - |
| + browser_received_swap_component.event_time).InMicroseconds(), |
| + 1, 1000000, 100); |
|
Alexei Svitkine (slow)
2015/02/12 15:31:33
If you're using the same ranges for all of these,
Yufeng Shen (Slow to review)
2015/02/12 21:33:25
Done.
|
| + |
| + UMA_HISTOGRAM_CUSTOM_COUNTS( |
| + "Event.Latency.ScrollUpdateGpuSwap", |
| + (swap_component.event_time - |
| + gpu_swap_component.event_time).InMicroseconds(), |
| + 1, 1000000, 100); |
| } |
| // LatencyComponents generated in the renderer must have component IDs |
| @@ -264,7 +327,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) { |