Only add samples to the idle time undershoot histogram if we actually did gc
authorjochen@chromium.org <jochen@chromium.org>
Thu, 25 Sep 2014 06:55:06 +0000 (06:55 +0000)
committerjochen@chromium.org <jochen@chromium.org>
Thu, 25 Sep 2014 06:55:06 +0000 (06:55 +0000)
BUG=none
R=hpayer@chromium.org
LOG=n

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24200 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/heap/heap.cc

index 1cc646e..3d0c2f0 100644 (file)
@@ -4352,8 +4352,10 @@ bool Heap::IdleNotification(int idle_time_in_ms) {
 
   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);
+    if (action.type != DONE && action.type != DO_NOTHING) {
+      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);