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

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

Issue 17757002: Add UMA/Telemetry stats for touch event latency (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add LatencyInfo::FindLatency() && Only use one metric for touch ack latency Created 7 years, 6 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
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index f37ec19ffa63c05d5d0d9437495f846648e3396b..bbd154f13a40952fa4fe7e1d8784d1a1876bbbd2 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -2565,6 +2565,53 @@ void RenderWidgetHostImpl::DetachDelegate() {
delegate_ = NULL;
}
+void RenderWidgetHostImpl::ComputeTouchLatency(
+ const ui::LatencyInfo& latency_info) {
+ ui::LatencyInfo::LatencyComponent ui_component;
+ ui::LatencyInfo::LatencyComponent rwh_component;
+ ui::LatencyInfo::LatencyComponent acked_component;
+
+ if (!latency_info.FindLatency(ui::INPUT_EVENT_LATENCY_UI_COMPONENT,
+ 0,
+ &ui_component) ||
+ !latency_info.FindLatency(ui::INPUT_EVENT_LATENCY_RWH_COMPONENT,
+ GetLatencyComponentId(),
+ &rwh_component))
+ return;
+
+ DCHECK(ui_component.event_count == 1);
+ DCHECK(rwh_component.event_count == 1);
+
+ base::TimeDelta ui_delta =
+ rwh_component.event_time - ui_component.event_time;
+ rendering_stats_.touch_ui_count++;
+ rendering_stats_.total_touch_ui_latency += ui_delta;
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "Event.Latency.Browser.TouchUI",
+ ui_delta.InMicroseconds(),
+ 0,
+ 20000,
+ 100);
+
+ latency_info.FindLatency(ui::INPUT_EVENT_LATENCY_ACKED_COMPONENT,
sadrul 2013/06/27 17:44:01 Check return value of FindLatency
Yufeng Shen (Slow to review) 2013/06/27 19:01:03 Done.
+ 0,
+ &acked_component);
+ base::TimeDelta acked_delta =
+ acked_component.event_time - rwh_component.event_time;
+ rendering_stats_.touch_acked_count++;
+ rendering_stats_.total_touch_acked_latency += acked_delta;
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "Event.Latency.Browser.TouchAcked",
+ acked_delta.InMicroseconds(),
+ 0,
+ 1000000,
+ 100);
+
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableGpuBenchmarking))
+ Send(new ViewMsg_SetBrowserRenderingStats(routing_id_, rendering_stats_));
+}
+
void RenderWidgetHostImpl::FrameSwapped(const ui::LatencyInfo& latency_info) {
ui::LatencyInfo::LatencyMap::const_iterator l =
latency_info.latency_components.find(std::make_pair(

Powered by Google App Engine
This is Rietveld 408576698