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

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 | « ui/base/events/event_utils.cc ('k') | 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..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
« no previous file with comments | « ui/base/events/event_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698