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() |