Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Unified Diff: src/gc-tracer.h

Issue 410413005: Add event statistics to GCTracer. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix comments. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gc-tracer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gc-tracer.h
diff --git a/src/gc-tracer.h b/src/gc-tracer.h
index a9e02b3118daabca29bc07174d17d43c2ae223db..b1e5c5d0c6c243ecd3d2b26f4a00543ec0bb4bea 100644
--- a/src/gc-tracer.h
+++ b/src/gc-tracer.h
@@ -202,6 +202,36 @@ class GCTracer BASE_EMBEDDED {
// Log an incremental marking step.
void AddIncrementalMarkingStep(double duration);
+ // Compute the mean duration of the last scavenger events. Returns 0 if no
+ // events have been recorded.
+ double MeanScavengerDuration() const {
+ return MeanDuration(scavenger_events_);
+ }
+
+ // Compute the max duration of the last scavenger events. Returns 0 if no
+ // events have been recorded.
+ double MaxScavengerDuration() const { return MaxDuration(scavenger_events_); }
+
+ // Compute the mean duration of the last mark compactor events. Returns 0 if
+ // no events have been recorded.
+ double MeanMarkCompactorDuration() const {
+ return MeanDuration(mark_compactor_events_);
+ }
+
+ // Compute the max duration of the last mark compactor events. Return 0 if no
+ // events have been recorded.
+ double MaxMarkCompactorDuration() const {
+ return MaxDuration(mark_compactor_events_);
+ }
+
+ // Compute the mean step duration of the last incremental marking round.
+ // Returns 0 if no incremental marking round has been completed.
+ double MeanIncrementalMarkingDuration() const;
+
+ // Compute the max step duration of the last incremental marking round.
+ // Returns 0 if no incremental marking round has been completed.
+ double MaxIncrementalMarkingDuration() const;
+
private:
// Print one detailed trace line in name=value format.
// TODO(ernstm): Move to Heap.
@@ -211,6 +241,12 @@ class GCTracer BASE_EMBEDDED {
// TODO(ernstm): Move to Heap.
void Print() const;
+ // Compute the mean duration of the events in the given ring buffer.
+ double MeanDuration(const EventBuffer& events) const;
+
+ // Compute the max duration of the events in the given ring buffer.
+ double MaxDuration(const EventBuffer& events) const;
+
// Pointer to the heap that owns this tracer.
Heap* heap_;
« no previous file with comments | « no previous file | src/gc-tracer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698