From b6898f55d27d40b60e1a4b0036ae809cc9123cee Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Wed, 9 Apr 2014 11:41:49 -0700 Subject: [PATCH] Add mean GC duration to DumpGcPerformanceInfo. Change-Id: Ibd68e9d8cae71d0ceb769fc975f1148287e9ca4a --- runtime/gc/heap.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index 72b8449f5..91f249ac2 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -662,12 +662,12 @@ void Heap::DumpGcPerformanceInfo(std::ostream& os) { // Dump cumulative timings. os << "Dumping cumulative Gc timings\n"; uint64_t total_duration = 0; - // Dump cumulative loggers for each GC type. uint64_t total_paused_time = 0; for (auto& collector : garbage_collectors_) { const CumulativeLogger& logger = collector->GetCumulativeTimings(); - if (logger.GetTotalNs() != 0) { + const size_t iterations = logger.GetIterations(); + if (iterations != 0) { os << ConstDumpable(logger); const uint64_t total_ns = logger.GetTotalNs(); const uint64_t total_pause_ns = collector->GetTotalPausedTimeNs(); @@ -677,7 +677,8 @@ void Heap::DumpGcPerformanceInfo(std::ostream& os) { Histogram::CumulativeData cumulative_data; collector->GetPauseHistogram().CreateHistogram(&cumulative_data); collector->GetPauseHistogram().PrintConfidenceIntervals(os, 0.99, cumulative_data); - os << collector->GetName() << " total time: " << PrettyDuration(total_ns) << "\n" + os << collector->GetName() << " total time: " << PrettyDuration(total_ns) + << " mean time: " << PrettyDuration(total_ns / iterations) << "\n" << collector->GetName() << " freed: " << freed_objects << " objects with total size " << PrettySize(freed_bytes) << "\n" << collector->GetName() << " throughput: " << freed_objects / seconds << "/s / " -- 2.11.0