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

Unified Diff: third_party/WebKit/Source/core/input/TouchEventManager.cpp

Issue 1983883002: Add UMA metric to track the time saved on making events passive before pageload (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change latency max and comment Created 4 years, 7 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 | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/input/TouchEventManager.cpp
diff --git a/third_party/WebKit/Source/core/input/TouchEventManager.cpp b/third_party/WebKit/Source/core/input/TouchEventManager.cpp
index 23c662db3de37c89c572522c479f0b4547ae49c8..369707250c9c3015ac876da901f825e991881f67 100644
--- a/third_party/WebKit/Source/core/input/TouchEventManager.cpp
+++ b/third_party/WebKit/Source/core/input/TouchEventManager.cpp
@@ -16,7 +16,7 @@
#include "core/page/Page.h"
#include "platform/Histogram.h"
#include "platform/PlatformTouchEvent.h"
-
+#include "wtf/CurrentTime.h"
namespace blink {
@@ -243,13 +243,20 @@ WebInputEventResult TouchEventManager::dispatchTouchEvents(
DEFINE_STATIC_LOCAL(EnumerationHistogram, rootDocumentListenerHistogram, ("Event.Touch.TargetAndDispatchResult", TouchTargetAndDispatchResultTypeMax));
rootDocumentListenerHistogram.count(toTouchTargetHistogramValue(eventTarget, domDispatchResult));
- // Count the handled touch starts and first touch moves before and after the page is fully loaded respectively.
+ // Record the disposition and latency of touch starts and first touch moves before and after the page is fully loaded respectively.
+ int64_t latencyInMicros = static_cast<int64_t>((currentTime() - event.timestamp()) * 1000000.0);
if (m_frame->document()->isLoadCompleted()) {
DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsAfterPageLoadHistogram, ("Event.Touch.TouchDispositionsAfterPageLoad", TouchEventDispatchResultTypeMax));
touchDispositionsAfterPageLoadHistogram.count((domDispatchResult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches);
+
+ DEFINE_STATIC_LOCAL(CustomCountHistogram, eventLatencyAfterPageLoadHistogram, ("Event.Touch.TouchesAfterPageLoadLatency", 1, 100000000, 100));
Ilya Sherman 2016/05/17 01:24:55 Do you need 100 buckets, or would 50 suffice? (50
lanwei 2016/05/17 17:57:30 Change to 50.
+ eventLatencyAfterPageLoadHistogram.count(latencyInMicros);
} else {
DEFINE_STATIC_LOCAL(EnumerationHistogram, touchDispositionsBeforePageLoadHistogram, ("Event.Touch.TouchDispositionsBeforePageLoad", TouchEventDispatchResultTypeMax));
touchDispositionsBeforePageLoadHistogram.count((domDispatchResult != DispatchEventResult::NotCanceled) ? HandledTouches : UnhandledTouches);
+
+ DEFINE_STATIC_LOCAL(CustomCountHistogram, eventLatencyBeforePageLoadHistogram, ("Event.Touch.TouchesBeforePageLoadLatency", 1, 100000000, 100));
Ilya Sherman 2016/05/17 01:24:55 Ditto
+ eventLatencyBeforePageLoadHistogram.count(latencyInMicros);
}
}
eventResult = EventHandler::mergeEventResult(eventResult,
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698