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

Unified Diff: Source/core/dom/ScriptedIdleTaskController.cpp

Issue 1344053002: Add UMA tracing to requestIdleCallback. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix overrun UMA name Created 5 years, 3 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 | Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ScriptedIdleTaskController.cpp
diff --git a/Source/core/dom/ScriptedIdleTaskController.cpp b/Source/core/dom/ScriptedIdleTaskController.cpp
index 34b65b67840c7d0f1b3c7f15adeeba7604da28d3..74eadc0252a86534de5bc5f5d028a065955761fe 100644
--- a/Source/core/dom/ScriptedIdleTaskController.cpp
+++ b/Source/core/dom/ScriptedIdleTaskController.cpp
@@ -119,8 +119,14 @@ void ScriptedIdleTaskController::runCallback(CallbackId id, double deadlineSecon
if (!callback)
return;
+ double allotedTimeMillis = std::max((deadlineSeconds - monotonicallyIncreasingTime()) * 1000, 0.0);
+ Platform::current()->histogramCustomCounts("WebCore.ScriptedIdleTaskController.IdleCallbackDeadline", allotedTimeMillis, 0, 50, 50);
+
// TODO(rmcilroy): Add devtools tracing.
callback->handleEvent(IdleDeadline::create(deadlineSeconds, callbackType));
+
+ double overrunMillis = std::max((monotonicallyIncreasingTime() - deadlineSeconds) * 1000, 0.0);
+ Platform::current()->histogramCustomCounts("WebCore.ScriptedIdleTaskController.IdleCallbackOverrun", overrunMillis, 0, 10000, 50);
}
void ScriptedIdleTaskController::stop()
« no previous file with comments | « no previous file | Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698