Reviewers: Hannes Payer,

Description:
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
[email protected]

Please review this at https://codereview.chromium.org/572293002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+15, -4 lines):
  M src/counters.h
  M src/heap/heap.cc


Index: src/counters.h
diff --git a/src/counters.h b/src/counters.h
index ed9f8a89aeb17115e90f17d6b629eae2c520908d..9b44435d782dc1cd545d06a2c220ef451f7c8b46 100644
--- a/src/counters.h
+++ b/src/counters.h
@@ -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_exceeded, V8.GCIdleTimeLimitExceeded, 0, 10000, 101) \
+  HR(gc_idle_time_limit_missed, V8.GCIdleTimeLimitMissed, 0, 10000, 101)

 #define HISTOGRAM_TIMER_LIST(HT)                             \
   /* Garbage collection timers. */                           \
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index c96ea97f1b026b0079d676112ee24dc51cb0927b..fc8ca7e565a9e3ddac3f40a5fa413dfc540c7b3b 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -4348,8 +4348,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);
+  }
+
   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();


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to