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

Unified Diff: src/gc-tracer.cc

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 | « src/gc-tracer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gc-tracer.cc
diff --git a/src/gc-tracer.cc b/src/gc-tracer.cc
index 86743cda23fa33a10da3c949ac3282a710ec52cc..3b381b3ad9c0c4b1843311edbc57122a1a526da0 100644
--- a/src/gc-tracer.cc
+++ b/src/gc-tracer.cc
@@ -268,5 +268,50 @@ void GCTracer::PrintNVP() const {
PrintF("\n");
}
+
+
+double GCTracer::MeanDuration(const EventBuffer& events) const {
+ if (events.empty()) return 0.0;
+
+ double mean = 0.0;
+ EventBuffer::const_iterator iter = events.begin();
+ while (iter != events.end()) {
+ mean += iter->end_time - iter->start_time;
+ ++iter;
+ }
+
+ return mean / events.size();
+}
+
+
+double GCTracer::MaxDuration(const EventBuffer& events) const {
+ if (events.empty()) return 0.0;
+
+ double maximum = 0.0f;
+ EventBuffer::const_iterator iter = events.begin();
+ while (iter != events.end()) {
+ maximum = Max(iter->end_time - iter->start_time, maximum);
+ ++iter;
+ }
+
+ return maximum;
+}
+
+
+double GCTracer::MeanIncrementalMarkingDuration() const {
+ if (mark_compactor_events_.empty()) return 0.0;
+
+ EventBuffer::const_iterator last_mc = mark_compactor_events_.begin();
+ return last_mc->incremental_marking_duration /
+ last_mc->incremental_marking_steps;
+}
+
+
+double GCTracer::MaxIncrementalMarkingDuration() const {
+ if (mark_compactor_events_.empty()) return 0.0;
+
+ EventBuffer::const_iterator last_mc = mark_compactor_events_.begin();
+ return last_mc->longest_incremental_marking_step;
+}
}
} // namespace v8::internal
« no previous file with comments | « src/gc-tracer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698