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

Unified Diff: src/counters.cc

Issue 875873002: Rescale histogram timers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: only change compilation-related histograms Created 5 years, 11 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 | « src/counters.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/counters.cc
diff --git a/src/counters.cc b/src/counters.cc
index ec5d21d47c3a415846f9e5c5c7537ddf04972d82..8cae329f5215ef6ae141f1f1b27d9bf6d5dc4329 100644
--- a/src/counters.cc
+++ b/src/counters.cc
@@ -47,8 +47,11 @@ void HistogramTimer::Start() {
// Stop the timer and record the results.
void HistogramTimer::Stop() {
if (Enabled()) {
- // Compute the delta between start and stop, in milliseconds.
- AddSample(static_cast<int>(timer_.Elapsed().InMilliseconds()));
+ int64_t sample = resolution_ == MICROSECOND
+ ? timer_.Elapsed().InMicroseconds()
+ : timer_.Elapsed().InMilliseconds();
+ // Compute the delta between start and stop, in microseconds.
+ AddSample(static_cast<int>(sample));
timer_.Stop();
}
Logger::CallEventLogger(isolate(), name(), Logger::END, true);
@@ -61,13 +64,13 @@ Counters::Counters(Isolate* isolate) {
HISTOGRAM_RANGE_LIST(HR)
#undef HR
-#define HT(name, caption) \
- name##_ = HistogramTimer(#caption, 0, 10000, 50, isolate);
+#define HT(name, caption, max, res) \
+ name##_ = HistogramTimer(#caption, 0, max, HistogramTimer::res, 50, isolate);
HISTOGRAM_TIMER_LIST(HT)
#undef HT
#define AHT(name, caption) \
- name##_ = AggregatableHistogramTimer(#caption, 0, 10000, 50, isolate);
+ name##_ = AggregatableHistogramTimer(#caption, 0, 10000000, 50, isolate);
AGGREGATABLE_HISTOGRAM_TIMER_LIST(AHT)
#undef AHT
@@ -157,7 +160,7 @@ void Counters::ResetHistograms() {
HISTOGRAM_RANGE_LIST(HR)
#undef HR
-#define HT(name, caption) name##_.Reset();
+#define HT(name, caption, max, res) name##_.Reset();
HISTOGRAM_TIMER_LIST(HT)
#undef HT
« no previous file with comments | « src/counters.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698