diff options
author | Mathieu Chartier <mathieuc@google.com> | 2013-11-20 17:26:00 -0800 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2013-11-21 12:02:28 -0800 |
commit | b2f9936cab87a187f078187c22d9b29d4a188a62 (patch) | |
tree | 601a1673d4c4aca428d69dff29a80c8f10cad214 /runtime/gc/collector/garbage_collector.h | |
parent | dcc5c7598d38fcb555266c8618df720acea3b954 (diff) | |
download | art-b2f9936cab87a187f078187c22d9b29d4a188a62.zip art-b2f9936cab87a187f078187c22d9b29d4a188a62.tar.gz art-b2f9936cab87a187f078187c22d9b29d4a188a62.tar.bz2 |
Add histogram for GC pause times.
Printed when you dump the GC performance info.
Bug: 10855285
Change-Id: I3bf7f958305f97c52cb31c03bdd6218c321575b9
Diffstat (limited to 'runtime/gc/collector/garbage_collector.h')
-rw-r--r-- | runtime/gc/collector/garbage_collector.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/runtime/gc/collector/garbage_collector.h b/runtime/gc/collector/garbage_collector.h index a80f593..1779339 100644 --- a/runtime/gc/collector/garbage_collector.h +++ b/runtime/gc/collector/garbage_collector.h @@ -17,10 +17,10 @@ #ifndef ART_RUNTIME_GC_COLLECTOR_GARBAGE_COLLECTOR_H_ #define ART_RUNTIME_GC_COLLECTOR_GARBAGE_COLLECTOR_H_ +#include "base/histogram.h" +#include "base/timing_logger.h" #include "gc_type.h" #include "locks.h" -#include "base/timing_logger.h" - #include <stdint.h> #include <vector> @@ -95,7 +95,7 @@ class GarbageCollector { } uint64_t GetTotalPausedTimeNs() const { - return total_paused_time_ns_; + return pause_histogram_.Sum(); } uint64_t GetTotalFreedBytes() const { @@ -106,6 +106,10 @@ class GarbageCollector { return total_freed_objects_; } + const Histogram<uint64_t>& GetPauseHistogram() const { + return pause_histogram_; + } + protected: // The initial phase. Done without mutators paused. virtual void InitializePhase() = 0; @@ -122,6 +126,9 @@ class GarbageCollector { // Called after the GC is finished. Done without mutators paused. virtual void FinishPhase() = 0; + static constexpr size_t kPauseBucketSize = 500; + static constexpr size_t kPauseBucketCount = 32; + Heap* const heap_; std::string name_; @@ -134,8 +141,8 @@ class GarbageCollector { TimingLogger timings_; // Cumulative statistics. + Histogram<uint64_t> pause_histogram_; uint64_t total_time_ns_; - uint64_t total_paused_time_ns_; uint64_t total_freed_objects_; uint64_t total_freed_bytes_; |