Index: ui/base/x/x11_util.cc |
diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc |
index da03cd17a80b0c2b77a34119313345ee5059f76d..470fa22149dad869c8976cc16f7f5ed603d22eb7 100644 |
--- a/ui/base/x/x11_util.cc |
+++ b/ui/base/x/x11_util.cc |
@@ -28,6 +28,7 @@ |
#include "base/memory/scoped_ptr.h" |
#include "base/memory/singleton.h" |
#include "base/message_loop.h" |
+#include "base/metrics/histogram.h" |
#include "base/string_number_conversions.h" |
#include "base/string_util.h" |
#include "base/stringprintf.h" |
@@ -629,6 +630,24 @@ int CoalescePendingMotionEvents(const XEvent* xev, |
} |
break; |
} |
+ if (num_coalesed > 0) { |
+ base::TimeDelta delta = ui::EventTimeFromNative(last_event) - |
+ ui::EventTimeFromNative(const_cast<XEvent*>(xev)); |
+ ui::EventType ui_type = ui::EventTypeFromNative(const_cast<XEvent*>(xev)); |
+ if (ui::IsMouseEventType(ui_type)) { |
+ UMA_HISTOGRAM_COUNTS_10000("Event.CoalescedCount.Mouse", num_coalesed); |
+ UMA_HISTOGRAM_CUSTOM_COUNTS("Event.CoalescedLatency.Mouse", |
+ delta.InMicroseconds(), 0, 1000000, 100); |
Rick Byers
2013/04/05 19:32:24
For these times I think microseconds is overkill.
varunjain
2013/04/05 22:04:07
Done.
|
+ } else if (ui::IsTouchEventType(ui_type)) { |
+ UMA_HISTOGRAM_COUNTS_10000("Event.CoalescedCount.Touch", num_coalesed); |
+ UMA_HISTOGRAM_CUSTOM_COUNTS("Event.CoalescedLatency.Touch", |
+ delta.InMicroseconds(), 0, 1000000, 100); |
+ } else { |
+ UMA_HISTOGRAM_COUNTS_10000("Event.CoalescedCount.Other", num_coalesed); |
+ UMA_HISTOGRAM_CUSTOM_COUNTS("Event.CoalescedLatency.Other", |
+ delta.InMicroseconds(), 0, 1000000, 100); |
+ } |
+ } |
return num_coalesed; |
} |
#endif |