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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerThread.cpp

Issue 2077153002: Worker: Record time taken for running a debugger/worker task on WorkerThread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix crashes on tests Created 4 years, 6 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') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/workers/WorkerThread.cpp
diff --git a/third_party/WebKit/Source/core/workers/WorkerThread.cpp b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
index 07896af90af00783e7e8521ddab9811cb381677c..632cefb70ce76bed0657b455cc16a15a3a1b0904 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
@@ -581,7 +581,11 @@ void WorkerThread::performTaskOnWorkerThread(std::unique_ptr<ExecutionContextTas
}
InspectorInstrumentation::AsyncTask asyncTask(globalScope, task.get(), isInstrumented);
- task->performTask(globalScope);
+ {
+ DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scopedUsCounter, new CustomCountHistogram("WorkerThread.Task.Time", 0, 10000000, 50));
+ ScopedUsHistogramTimer timer(scopedUsCounter);
+ task->performTask(globalScope);
+ }
}
void WorkerThread::performDebuggerTaskOnWorkerThread(std::unique_ptr<CrossThreadClosure> task)
@@ -594,7 +598,11 @@ void WorkerThread::performDebuggerTaskOnWorkerThread(std::unique_ptr<CrossThread
m_runningDebuggerTask = true;
}
ThreadDebugger::idleFinished(isolate());
- (*task)();
+ {
+ DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scopedUsCounter, new CustomCountHistogram("WorkerThread.DebuggerTask.Time", 0, 10000000, 50));
+ ScopedUsHistogramTimer timer(scopedUsCounter);
+ (*task)();
+ }
ThreadDebugger::idleStarted(isolate());
{
MutexLocker lock(m_threadStateMutex);
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698