summaryrefslogtreecommitdiffstats
path: root/runtime/gc/collector
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/gc/collector')
-rw-r--r--runtime/gc/collector/garbage_collector.cc8
-rw-r--r--runtime/gc/collector/garbage_collector.h3
2 files changed, 11 insertions, 0 deletions
diff --git a/runtime/gc/collector/garbage_collector.cc b/runtime/gc/collector/garbage_collector.cc
index 82340f5..a700c73 100644
--- a/runtime/gc/collector/garbage_collector.cc
+++ b/runtime/gc/collector/garbage_collector.cc
@@ -204,6 +204,14 @@ uint64_t GarbageCollector::GetEstimatedLastIterationThroughput() const {
return (static_cast<uint64_t>(freed_bytes_) * 1000) / (NsToMs(GetDurationNs()) + 1);
}
+void GarbageCollector::ResetMeasurements() {
+ cumulative_timings_.Reset();
+ pause_histogram_.Reset();
+ total_time_ns_ = 0;
+ total_freed_objects_ = 0;
+ total_freed_bytes_ = 0;
+}
+
} // namespace collector
} // namespace gc
} // namespace art
diff --git a/runtime/gc/collector/garbage_collector.h b/runtime/gc/collector/garbage_collector.h
index 5b7b8a2..b19ac3f 100644
--- a/runtime/gc/collector/garbage_collector.h
+++ b/runtime/gc/collector/garbage_collector.h
@@ -110,6 +110,9 @@ class GarbageCollector {
return pause_histogram_;
}
+ // Reset the cumulative timings and pause histogram.
+ void ResetMeasurements();
+
// Returns the estimated throughput in bytes / second.
uint64_t GetEstimatedMeanThroughput() const;