Index: src/heap/gc-tracer.h |
diff --git a/src/heap/gc-tracer.h b/src/heap/gc-tracer.h |
index 1fad040d91e1cc686bcecd37ee0b2fbe8ebb4db2..d9671d49a80d207d7944cbfd324c4193ea554557 100644 |
--- a/src/heap/gc-tracer.h |
+++ b/src/heap/gc-tracer.h |
@@ -178,6 +178,18 @@ class GCTracer { |
}; |
+ class CompactionEvent { |
+ public: |
+ CompactionEvent() : duration(0), live_bytes_compacted(0) {} |
+ |
+ CompactionEvent(double duration, intptr_t live_bytes_compacted) |
+ : duration(duration), live_bytes_compacted(live_bytes_compacted) {} |
+ |
+ double duration; |
+ intptr_t live_bytes_compacted; |
+ }; |
+ |
+ |
class ContextDisposalEvent { |
public: |
// Default constructor leaves the event uninitialized. |
@@ -314,6 +326,8 @@ class GCTracer { |
typedef RingBuffer<ContextDisposalEvent, kRingBufferMaxSize> |
ContextDisposalEventBuffer; |
+ typedef RingBuffer<CompactionEvent, kRingBufferMaxSize> CompactionEventBuffer; |
+ |
typedef RingBuffer<SurvivalEvent, kRingBufferMaxSize> SurvivalEventBuffer; |
static const int kThroughputTimeFrameMs = 5000; |
@@ -336,6 +350,8 @@ class GCTracer { |
void AddContextDisposalTime(double time); |
+ void AddCompactionEvent(double duration, intptr_t live_bytes_compacted); |
+ |
void AddSurvivalRatio(double survival_ratio); |
// Log an incremental marking step. |
@@ -406,6 +422,8 @@ class GCTracer { |
intptr_t ScavengeSpeedInBytesPerMillisecond( |
ScavengeSpeedMode mode = kForAllObjects) const; |
+ intptr_t CompactionSpeedInBytesPerMillisecond() const; |
Hannes Payer (out of office)
2015/11/03 04:08:17
Add comment, like others.
Michael Lippautz
2015/11/03 20:57:42
Done.
|
+ |
// Compute the average mark-sweep speed in bytes/millisecond. |
// Returns 0 if no events have been recorded. |
intptr_t MarkCompactSpeedInBytesPerMillisecond() const; |
@@ -520,6 +538,8 @@ class GCTracer { |
// RingBuffer for context disposal events. |
ContextDisposalEventBuffer context_disposal_events_; |
+ CompactionEventBuffer compaction_events_; |
Hannes Payer (out of office)
2015/11/03 04:08:17
Comment.
Michael Lippautz
2015/11/03 20:57:42
Done.
|
+ |
// RingBuffer for survival events. |
SurvivalEventBuffer survival_events_; |