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

Unified Diff: Source/platform/heap/ThreadState.cpp

Issue 304673003: Add UMAs about Blink GC metrics (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
« Source/platform/heap/Heap.cpp ('K') | « Source/platform/heap/Heap.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/ThreadState.cpp
diff --git a/Source/platform/heap/ThreadState.cpp b/Source/platform/heap/ThreadState.cpp
index aaef9c1d8a73899115ae6a0840800578c7e63b0b..94d84b9b640d64f6c756430819e31835b3a80e92 100644
--- a/Source/platform/heap/ThreadState.cpp
+++ b/Source/platform/heap/ThreadState.cpp
@@ -35,6 +35,7 @@
#include "platform/heap/AddressSanitizer.h"
#include "platform/heap/Handle.h"
#include "platform/heap/Heap.h"
+#include "public/platform/Platform.h"
#include "wtf/ThreadingPrimitives.h"
#if OS(WIN)
@@ -819,8 +820,11 @@ void ThreadState::performPendingSweep()
TRACE_EVENT0("Blink", "ThreadState::performPendingSweep");
const char* samplingState = TRACE_EVENT_GET_SAMPLING_STATE();
- if (isMainThread())
+ double timeStamp = 0;
+ if (isMainThread()) {
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "BlinkGCSweeping");
+ timeStamp = WTF::currentTimeMS();
Mads Ager (chromium) 2014/05/28 09:35:45 Is histogram collection also not thread safe? It w
haraken 2014/05/28 09:40:15 It's thread-safe. At first, I thought that if we
haraken 2014/05/28 10:40:26 Done.
+ }
m_sweepInProgress = true;
// Disallow allocation during weak processing.
@@ -837,8 +841,12 @@ void ThreadState::performPendingSweep()
clearGCRequested();
clearSweepRequested();
- if (isMainThread())
+ if (isMainThread()) {
TRACE_EVENT_SET_NONCONST_SAMPLING_STATE(samplingState);
+ if (blink::Platform::current()) {
+ blink::Platform::current()->histogramEnumeration("BlinkGC.PerformPendingSweep", WTF::currentTimeMS() - timeStamp, 30000);
+ }
+ }
}
void ThreadState::addInterruptor(Interruptor* interruptor)
« Source/platform/heap/Heap.cpp ('K') | « Source/platform/heap/Heap.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698