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

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: 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..d145f6dc2ed46bea77f154d882ddbb13b4351eb1 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);
jochen (gone - plz use gerrit) 2015/09/15 16:38:46 that looks like it's in seconds?
rmcilroy 2015/09/15 16:50:46 I don't think so. The seconds values are multiplie
jochen (gone - plz use gerrit) 2015/09/15 16:53:37 hum, ok, so you expect that there will be at most
Sami 2015/09/15 17:01:04 Right, that 50ms maximum required by the spec too.
rmcilroy 2015/09/15 17:03:23 Yup, the spec explicitly limits the maximum deadli
+
// 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.idleCallbackOverrunMs", overrunMillis, 0, 10000, 50);
Sami 2015/09/15 16:58:44 "idle" isn't capitalized here but is above -- I gu
rmcilroy 2015/09/15 17:05:22 Argh, changed this locally but didn't upload. Than
rmcilroy 2015/09/15 17:19:50 Done.
}
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