summaryrefslogtreecommitdiffstats
path: root/runtime/base/histogram-inl.h
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2013-11-20 14:07:54 -0800
committerMathieu Chartier <mathieuc@google.com>2013-11-20 15:28:24 -0800
commit19b0a913d9127a70ca35ebae166312bc6eee3196 (patch)
treed41786c6425a535f37aa90fc1f4621b24793eb6c /runtime/base/histogram-inl.h
parent1febddf359ae500ef1bb01ab4883b076fcb56440 (diff)
downloadandroid_art-19b0a913d9127a70ca35ebae166312bc6eee3196.tar.gz
android_art-19b0a913d9127a70ca35ebae166312bc6eee3196.tar.bz2
android_art-19b0a913d9127a70ca35ebae166312bc6eee3196.zip
Improve histogram and timing logger dumping.
We now dump the sum (total time) of each histogram as well as previous stats. This is useful for the GC since the same split can occur multiple times per GC iteration. Also did a few memory optimizations by changing the map in the cumulative loggers to be a set. Bug: 11789200 Change-Id: I67bcc5384200924c8dc5d9eebcff077ce72b7e57
Diffstat (limited to 'runtime/base/histogram-inl.h')
-rw-r--r--runtime/base/histogram-inl.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/runtime/base/histogram-inl.h b/runtime/base/histogram-inl.h
index 9e08ae6feb..4cd68cda44 100644
--- a/runtime/base/histogram-inl.h
+++ b/runtime/base/histogram-inl.h
@@ -39,6 +39,13 @@ template <class Value> inline void Histogram<Value>::AddValue(Value value) {
BucketiseValue(value);
}
+template <class Value> inline Histogram<Value>::Histogram(const char* name)
+ : kAdjust(0),
+ kInitialBucketCount(0),
+ name_(name),
+ max_buckets_(0) {
+}
+
template <class Value>
inline Histogram<Value>::Histogram(const char* name, Value initial_bucket_width,
size_t max_buckets)
@@ -162,8 +169,9 @@ inline void Histogram<Value>::PrintConfidenceIntervals(std::ostream &os, double
double per_0 = (1.0 - interval) / 2.0;
double per_1 = per_0 + interval;
- os << Name() << ":\t";
TimeUnit unit = GetAppropriateTimeUnit(Mean() * kAdjust);
+ os << Name() << ":\tSum: ";
+ os << PrettyDuration(Sum() * kAdjust) << " ";
os << (interval * 100) << "% C.I. " << FormatDuration(Percentile(per_0, data) * kAdjust, unit);
os << "-" << FormatDuration(Percentile(per_1, data) * kAdjust, unit) << " ";
os << "Avg: " << FormatDuration(Mean() * kAdjust, unit) << " Max: ";