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

Unified Diff: content/browser/renderer_host/render_widget_host_latency_tracker.cc

Issue 1093923002: Track input latency for both begin and end of GPU swap in UMAs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: start <-> end Created 5 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 07df66014ca774bff338542cc42c710f66e4e507..a815367ef7b771b4430c201e35e815d704a82de9 100644
--- a/content/browser/renderer_host/render_widget_host_latency_tracker.cc
+++ b/content/browser/renderer_host/render_widget_host_latency_tracker.cc
@@ -135,6 +135,12 @@ void ComputeInputLatencyHistograms(WebInputEvent::Type type,
}
}
+// Touch to scroll latency that is mostly under 1 second.
+#define UMA_HISTOGRAM_TOUCH_TO_SCROLL_LATENCY(name, start, end) \
+ UMA_HISTOGRAM_CUSTOM_COUNTS( \
+ name, (end.event_time - start.event_time).InMicroseconds(), 1, 1000000, \
+ 100)
+
// Long scroll latency component that is mostly under 200ms.
#define UMA_HISTOGRAM_SCROLL_LATENCY_LONG(name, start, end) \
UMA_HISTOGRAM_CUSTOM_COUNTS( \
@@ -150,10 +156,12 @@ void ComputeInputLatencyHistograms(WebInputEvent::Type type,
1, 50000, 50)
void ComputeScrollLatencyHistograms(
- const LatencyInfo::LatencyComponent& gpu_swap_component,
+ const LatencyInfo::LatencyComponent& gpu_swap_begin_component,
+ const LatencyInfo::LatencyComponent& gpu_swap_end_component,
int64 latency_component_id,
const LatencyInfo& latency) {
- DCHECK(!gpu_swap_component.event_time.is_null());
+ DCHECK(!gpu_swap_begin_component.event_time.is_null());
+ DCHECK(!gpu_swap_end_component.event_time.is_null());
LatencyInfo::LatencyComponent first_original_component, original_component;
if (latency.FindLatency(
ui::INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL_COMPONENT,
@@ -162,11 +170,14 @@ void ComputeScrollLatencyHistograms(
// first scroll event in a sequence and the original timestamp of that
// scroll event's underlying touch event.
for (size_t i = 0; i < first_original_component.event_count; i++) {
- UMA_HISTOGRAM_CUSTOM_COUNTS(
- "Event.Latency.TouchToFirstScrollUpdateSwap",
- (gpu_swap_component.event_time - first_original_component.event_time)
- .InMicroseconds(),
- 1, 1000000, 100);
+ UMA_HISTOGRAM_TOUCH_TO_SCROLL_LATENCY(
+ "Event.Latency.TouchToFirstScrollUpdateSwapBegin",
+ gpu_swap_begin_component, first_original_component);
Yufeng Shen (Slow to review) 2015/04/17 22:28:42 the start/end order is reversed and ditto to all t
brianderson 2015/04/17 22:52:50 Done.
+ // TODO(brianderson): Remove this version once we have enough overlapping
+ // data with the metric above.
+ UMA_HISTOGRAM_TOUCH_TO_SCROLL_LATENCY(
+ "Event.Latency.TouchToFirstScrollUpdateSwap", gpu_swap_end_component,
+ first_original_component);
}
original_component = first_original_component;
} else if (!latency.FindLatency(
@@ -179,11 +190,14 @@ void ComputeScrollLatencyHistograms(
// created (averaged if there are multiple) to when the scroll gesture
// results in final frame swap.
for (size_t i = 0; i < original_component.event_count; i++) {
- UMA_HISTOGRAM_CUSTOM_COUNTS(
- "Event.Latency.TouchToScrollUpdateSwap",
- (gpu_swap_component.event_time - original_component.event_time)
- .InMicroseconds(),
- 1, 1000000, 100);
+ UMA_HISTOGRAM_TOUCH_TO_SCROLL_LATENCY(
+ "Event.Latency.TouchToScrollUpdateSwapBegin", gpu_swap_begin_component,
+ original_component);
+ // TODO(brianderson): Remove this version once we have enough overlapping
+ // data with the metric above.
+ UMA_HISTOGRAM_TOUCH_TO_SCROLL_LATENCY(
+ "Event.Latency.TouchToScrollUpdateSwap", gpu_swap_end_component,
+ original_component);
}
// TODO(miletus): Add validation for making sure the following components
@@ -237,17 +251,11 @@ void ComputeScrollLatencyHistograms(
UMA_HISTOGRAM_SCROLL_LATENCY_LONG(
"Event.Latency.ScrollUpdate.BrowserNotifiedToBeforeGpuSwap",
- browser_received_swap_component, gpu_swap_component);
-
- LatencyInfo::LatencyComponent gpu_swap_ack_component;
- if (!latency.FindLatency(
- ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0,
- &gpu_swap_ack_component))
- return;
+ browser_received_swap_component, gpu_swap_begin_component);
UMA_HISTOGRAM_SCROLL_LATENCY_SHORT("Event.Latency.ScrollUpdate.GpuSwap",
- gpu_swap_component,
- gpu_swap_ack_component);
+ gpu_swap_begin_component,
+ gpu_swap_end_component);
}
// LatencyComponents generated in the renderer must have component IDs
@@ -403,9 +411,16 @@ void RenderWidgetHostLatencyTracker::OnSwapCompositorFrame(
void RenderWidgetHostLatencyTracker::OnFrameSwapped(
const LatencyInfo& latency) {
- LatencyInfo::LatencyComponent gpu_swap_component;
+ LatencyInfo::LatencyComponent gpu_swap_end_component;
+ if (!latency.FindLatency(
+ ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0,
+ &gpu_swap_end_component)) {
+ return;
+ }
+
+ LatencyInfo::LatencyComponent gpu_swap_begin_component;
if (!latency.FindLatency(ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0,
- &gpu_swap_component)) {
+ &gpu_swap_begin_component)) {
return;
}
@@ -413,7 +428,7 @@ void RenderWidgetHostLatencyTracker::OnFrameSwapped(
if (latency.FindLatency(ui::TAB_SHOW_COMPONENT, latency_component_id_,
&tab_switch_component)) {
base::TimeDelta delta =
- gpu_swap_component.event_time - tab_switch_component.event_time;
+ gpu_swap_end_component.event_time - tab_switch_component.event_time;
for (size_t i = 0; i < tab_switch_component.event_count; i++) {
UMA_HISTOGRAM_TIMES("MPArch.RWH_TabSwitchPaintDuration", delta);
}
@@ -424,7 +439,8 @@ void RenderWidgetHostLatencyTracker::OnFrameSwapped(
return;
}
- ComputeScrollLatencyHistograms(gpu_swap_component, latency_component_id_,
+ ComputeScrollLatencyHistograms(gpu_swap_begin_component,
+ gpu_swap_end_component, latency_component_id_,
latency);
LatencyInfo::LatencyComponent browser_swap_component;
@@ -432,7 +448,7 @@ void RenderWidgetHostLatencyTracker::OnFrameSwapped(
ui::INPUT_EVENT_BROWSER_RECEIVED_RENDERER_SWAP_COMPONENT, 0,
&browser_swap_component)) {
base::TimeDelta delta =
- gpu_swap_component.event_time - browser_swap_component.event_time;
+ gpu_swap_begin_component.event_time - browser_swap_component.event_time;
browser_composite_latency_history_.InsertSample(delta);
}
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698