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

Unified Diff: content/renderer/input/input_handler_proxy.cc

Issue 764403002: Expand UMA coverage for compositor-handled events and fling FPS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweak phrasing Created 6 years 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/renderer/input/input_handler_proxy.cc
diff --git a/content/renderer/input/input_handler_proxy.cc b/content/renderer/input/input_handler_proxy.cc
index 0d4b17320a1986903d7c6942d404731474f9c534..6c4a9f29f8352748b16d20b70c6d748ac22e02aa 100644
--- a/content/renderer/input/input_handler_proxy.cc
+++ b/content/renderer/input/input_handler_proxy.cc
@@ -115,11 +115,15 @@ WebGestureEvent ObtainGestureScrollBegin(const WebGestureEvent& event) {
return scroll_begin_event;
}
-void SendScrollLatencyUma(const WebInputEvent& event,
- const ui::LatencyInfo& latency_info) {
+void ReportInputEventLatencyUma(const WebInputEvent& event,
+ const ui::LatencyInfo& latency_info) {
if (!(event.type == WebInputEvent::GestureScrollBegin ||
- event.type == WebInputEvent::GestureScrollUpdate))
+ event.type == WebInputEvent::GestureScrollUpdate ||
+ event.type == WebInputEvent::GesturePinchBegin ||
+ event.type == WebInputEvent::GesturePinchUpdate ||
+ event.type == WebInputEvent::GestureFlingStart)) {
return;
+ }
ui::LatencyInfo::LatencyMap::const_iterator it =
latency_info.latency_components.find(std::make_pair(
@@ -130,17 +134,42 @@ void SendScrollLatencyUma(const WebInputEvent& event,
base::TimeDelta delta = base::TimeTicks::HighResNow() - it->second.event_time;
for (size_t i = 0; i < it->second.event_count; ++i) {
- UMA_HISTOGRAM_CUSTOM_COUNTS(
- "Event.Latency.RendererImpl.GestureScroll2",
- delta.InMicroseconds(),
- 1,
- 1000000,
- 100);
+ switch (event.type) {
+ case blink::WebInputEvent::GestureScrollBegin:
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "Event.Latency.RendererImpl.GestureScrollBegin",
tdresser 2014/12/02 14:42:27 I think factoring out the histogram name here woul
+ delta.InMicroseconds(), 1, 1000000, 100);
+ break;
+ case blink::WebInputEvent::GestureScrollUpdate:
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ // So named for historical reasons.
+ "Event.Latency.RendererImpl.GestureScroll2",
+ delta.InMicroseconds(), 1, 1000000, 100);
+ break;
+ case blink::WebInputEvent::GesturePinchBegin:
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "Event.Latency.RendererImpl.GesturePinchBegin",
+ delta.InMicroseconds(), 1, 1000000, 100);
+ break;
+ case blink::WebInputEvent::GesturePinchUpdate:
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "Event.Latency.RendererImpl.GesturePinchUpdate",
+ delta.InMicroseconds(), 1, 1000000, 100);
+ break;
+ case blink::WebInputEvent::GestureFlingStart:
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "Event.Latency.RendererImpl.GestureFlingStart",
+ delta.InMicroseconds(), 1, 1000000, 100);
+ break;
+ default:
+ NOTREACHED();
+ break;
+ }
}
-} // namespace
-
}
+} // namespace
+
namespace content {
InputHandlerProxy::InputHandlerProxy(cc::InputHandler* input_handler,
@@ -156,7 +185,9 @@ InputHandlerProxy::InputHandlerProxy(cc::InputHandler* input_handler,
fling_may_be_active_on_main_thread_(false),
disallow_horizontal_fling_scroll_(false),
disallow_vertical_fling_scroll_(false),
- has_fling_animation_started_(false) {
+ has_fling_animation_started_(false),
+ uma_latency_reporting_enabled_(
+ base::TimeTicks::IsHighResNowFastAndReliable()) {
tdresser 2014/12/02 14:42:27 Do you know if other metrics report low res data,
jdduke (slow) 2014/12/02 20:04:56 Good question, I'd have to defer to Yufeng. What i
miletus1 2014/12/02 22:22:34 I don't remember GestureScroll2 is conditioned on
DCHECK(client);
input_handler_->BindToClient(this);
smooth_scroll_enabled_ = CommandLine::ForCurrentProcess()->HasSwitch(
@@ -185,7 +216,8 @@ InputHandlerProxy::HandleInputEventWithLatencyInfo(
ui::LatencyInfo* latency_info) {
DCHECK(input_handler_);
- SendScrollLatencyUma(event, *latency_info);
+ if (uma_latency_reporting_enabled_)
+ ReportInputEvenLatencyUma(event, *latency_info);
TRACE_EVENT_FLOW_STEP0("input",
"LatencyInfo.Flow",

Powered by Google App Engine
This is Rietveld 408576698