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

Unified Diff: ui/base/x/x11_util.cc

Issue 13529009: Add UMA metrics for measuring number of coalesed events and their latency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..14522b500c43932e24e996b897e1dc12f99dc645 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,21 @@ int CoalescePendingMotionEvents(const XEvent* xev,
}
break;
}
+
+ if (num_coalesed > 0) {
+ base::TimeDelta delta = ui::EventTimeFromNative(last_event) -
+ ui::EventTimeFromNative(const_cast<XEvent*>(xev));
+ if (event_type == XI_Motion) {
+ UMA_HISTOGRAM_COUNTS_10000("Event.CoalescedCount.Mouse", num_coalesed);
+ UMA_HISTOGRAM_TIMES("Event.CoalescedLatency.Mouse", delta);
+ } else {
+#if defined(USE_XI2_MT)
+ DCHECK_EQ(event_type, XI_TouchUpdate);
+#endif
+ UMA_HISTOGRAM_COUNTS_10000("Event.CoalescedCount.Touch", num_coalesed);
+ UMA_HISTOGRAM_TIMES("Event.CoalescedLatency.Touch", delta);
+ }
+ }
return num_coalesed;
}
#endif
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698