Commit cc66fb85 authored by jochen@chromium.org's avatar jochen@chromium.org

Track how much we miss the idle notification limit

We can't report negative values using histograms, so we split the data
up into two histograms

BUG=chromium:397026
LOG=n
R=hpayer@chromium.org

Review URL: https://codereview.chromium.org/572293002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23981 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5134a180
......@@ -291,9 +291,11 @@ class HistogramTimerScope BASE_EMBEDDED {
#endif
};
#define HISTOGRAM_RANGE_LIST(HR) \
/* Generic range histograms */ \
HR(gc_idle_time_allotted_in_ms, V8.GCIdleTimeAllottedInMS, 0, 10000, 101)
#define HISTOGRAM_RANGE_LIST(HR) \
/* Generic range histograms */ \
HR(gc_idle_time_allotted_in_ms, V8.GCIdleTimeAllottedInMS, 0, 10000, 101) \
HR(gc_idle_time_limit_overshot, V8.GCIdleTimeLimit.Overshot, 0, 10000, 101) \
HR(gc_idle_time_limit_undershot, V8.GCIdleTimeLimi.Undershot, 0, 10000, 101)
#define HISTOGRAM_TIMER_LIST(HT) \
/* Garbage collection timers. */ \
......
......@@ -4290,9 +4290,7 @@ bool Heap::IdleNotification(int idle_time_in_ms) {
// If incremental marking is off, we do not perform idle notification.
if (!FLAG_incremental_marking) return true;
base::ElapsedTimer timer;
if (FLAG_trace_idle_notification) {
timer.Start();
}
timer.Start();
isolate()->counters()->gc_idle_time_allotted_in_ms()->AddSample(
idle_time_in_ms);
HistogramTimerScope idle_notification_scope(
......@@ -4348,8 +4346,17 @@ bool Heap::IdleNotification(int idle_time_in_ms) {
case DO_NOTHING:
break;
}
int actual_time_ms = static_cast<int>(timer.Elapsed().InMilliseconds());
if (actual_time_ms <= idle_time_in_ms) {
isolate()->counters()->gc_idle_time_limit_undershot()->AddSample(
idle_time_in_ms - actual_time_ms);
} else {
isolate()->counters()->gc_idle_time_limit_overshot()->AddSample(
actual_time_ms - idle_time_in_ms);
}
if (FLAG_trace_idle_notification) {
int actual_time_ms = static_cast<int>(timer.Elapsed().InMilliseconds());
PrintF("Idle notification: requested idle time %d ms, actual time %d ms [",
idle_time_in_ms, actual_time_ms);
action.Print();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment