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

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

Issue 1659053002: Remove custom counts histogram from the blink API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a few thread_safe_static_local -> static_local as per feedback in reviews Created 4 years, 10 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
Index: third_party/WebKit/Source/platform/heap/ThreadState.cpp
diff --git a/third_party/WebKit/Source/platform/heap/ThreadState.cpp b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
index 9de5549437e8814087cb2df86d36621584ab65f4..610e7d13a90620100ad2c9e7b0aca62b5599d3e0 100644
--- a/third_party/WebKit/Source/platform/heap/ThreadState.cpp
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
@@ -30,6 +30,7 @@
#include "platform/heap/ThreadState.h"
+#include "platform/Histogram.h"
#include "platform/ScriptForbiddenScope.h"
#include "platform/TraceEvent.h"
#include "platform/heap/BlinkGCMemoryDumpProvider.h"
@@ -485,7 +486,8 @@ void ThreadState::threadLocalWeakProcessing()
if (isMainThread()) {
double timeForThreadLocalWeakProcessing = WTF::currentTimeMS() - startTime;
- Platform::current()->histogramCustomCounts("BlinkGC.timeForThreadLocalWeakProcessing", timeForThreadLocalWeakProcessing, 1, 10 * 1000, 50);
+ DEFINE_STATIC_LOCAL(CustomCountHistogram, timeForWeakHistogram, ("BlinkGC.timeForThreadLocalWeakProcessing", 1, 10 * 1000, 50));
+ timeForWeakHistogram.count(timeForThreadLocalWeakProcessing);
}
}
@@ -1100,8 +1102,10 @@ void ThreadState::completeSweep()
double timeForCompleteSweep = WTF::currentTimeMS() - startTime;
accumulateSweepingTime(timeForCompleteSweep);
- if (isMainThread())
- Platform::current()->histogramCustomCounts("BlinkGC.CompleteSweep", timeForCompleteSweep, 1, 10 * 1000, 50);
+ if (isMainThread()) {
+ DEFINE_STATIC_LOCAL(CustomCountHistogram, completeSweepHistogram, ("BlinkGC.CompleteSweep", 1, 10 * 1000, 50));
+ completeSweepHistogram.count(timeForCompleteSweep);
+ }
}
postSweep();
@@ -1126,10 +1130,14 @@ void ThreadState::postSweep()
// thread has not yet finished lazy sweeping.
Heap::setMarkedObjectSizeAtLastCompleteSweep(Heap::markedObjectSize());
- Platform::current()->histogramCustomCounts("BlinkGC.ObjectSizeBeforeGC", Heap::objectSizeAtLastGC() / 1024, 1, 4 * 1024 * 1024, 50);
- Platform::current()->histogramCustomCounts("BlinkGC.ObjectSizeAfterGC", Heap::markedObjectSize() / 1024, 1, 4 * 1024 * 1024, 50);
- Platform::current()->histogramCustomCounts("BlinkGC.CollectionRate", static_cast<int>(100 * collectionRate), 1, 100, 20);
- Platform::current()->histogramCustomCounts("BlinkGC.TimeForSweepingAllObjects", m_accumulatedSweepingTime, 1, 10 * 1000, 50);
+ DEFINE_STATIC_LOCAL(CustomCountHistogram, objectSizeBeforeGCHistogram, ("BlinkGC.ObjectSizeBeforeGC", 1, 4 * 1024 * 1024, 50));
+ objectSizeBeforeGCHistogram.count(Heap::objectSizeAtLastGC() / 1024);
+ DEFINE_STATIC_LOCAL(CustomCountHistogram, objectSizeAfterGCHistogram, ("BlinkGC.ObjectSizeAfterGC", 1, 4 * 1024 * 1024, 50));
+ objectSizeAfterGCHistogram.count(Heap::markedObjectSize() / 1024);
+ DEFINE_STATIC_LOCAL(CustomCountHistogram, collectionRateHistogram, ("BlinkGC.CollectionRate", 1, 100, 20));
+ collectionRateHistogram.count(static_cast<int>(100 * collectionRate));
+ DEFINE_STATIC_LOCAL(CustomCountHistogram, timeForSweepHistogram, ("BlinkGC.TimeForSweepingAllObjects", 1, 10 * 1000, 50));
+ timeForSweepHistogram.count(m_accumulatedSweepingTime);
}
switch (gcState()) {
@@ -1375,7 +1383,8 @@ void ThreadState::invokePreFinalizers()
}
if (isMainThread()) {
double timeForInvokingPreFinalizers = WTF::currentTimeMS() - startTime;
- Platform::current()->histogramCustomCounts("BlinkGC.TimeForInvokingPreFinalizers", timeForInvokingPreFinalizers, 1, 10 * 1000, 50);
+ DEFINE_STATIC_LOCAL(CustomCountHistogram, preFinalizersHistogram, ("BlinkGC.TimeForInvokingPreFinalizers", 1, 10 * 1000, 50));
+ preFinalizersHistogram.count(timeForInvokingPreFinalizers);
}
}
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Heap.cpp ('k') | third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698