Chromium Code Reviews| Index: src/heap/heap.cc |
| diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
| index c96ea97f1b026b0079d676112ee24dc51cb0927b..566ba85df6bc4fb8af78ea91615da36fa748f11a 100644 |
| --- a/src/heap/heap.cc |
| +++ b/src/heap/heap.cc |
| @@ -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_missed()->AddSample( |
| + idle_time_in_ms - actual_time_ms); |
| + } else { |
| + isolate()->counters()->gc_idle_time_limit_exceeded()->AddSample( |
| + actual_time_ms - idle_time_in_ms); |
| + } |
|
Hannes Payer (out of office)
2014/09/16 14:29:34
What about the perfect sample? Should we add it to
|
| + |
| 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(); |