OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_METRICS_HISTOGRAM_BASE_H_ | 5 #ifndef BASE_METRICS_HISTOGRAM_BASE_H_ |
6 #define BASE_METRICS_HISTOGRAM_BASE_H_ | 6 #define BASE_METRICS_HISTOGRAM_BASE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // Subclasses should implement this function to make SerializeInfo work. | 135 // Subclasses should implement this function to make SerializeInfo work. |
136 virtual bool SerializeInfoImpl(Pickle* pickle) const = 0; | 136 virtual bool SerializeInfoImpl(Pickle* pickle) const = 0; |
137 | 137 |
138 // Writes information about the construction parameters in |params|. | 138 // Writes information about the construction parameters in |params|. |
139 virtual void GetParameters(DictionaryValue* params) const = 0; | 139 virtual void GetParameters(DictionaryValue* params) const = 0; |
140 | 140 |
141 // Writes information about the current (non-empty) buckets and their sample | 141 // Writes information about the current (non-empty) buckets and their sample |
142 // counts to |buckets| and the total sample count to |count|. | 142 // counts to |buckets| and the total sample count to |count|. |
143 virtual void GetCountAndBucketData(Count* count, | 143 virtual void GetCountAndBucketData(Count* count, |
144 ListValue* buckets) const = 0; | 144 ListValue* buckets) const = 0; |
| 145 |
| 146 //// Produce actual graph (set of blank vs non blank char's) for a bucket. |
| 147 void WriteAsciiBucketGraph(double current_size, |
| 148 double max_size, |
| 149 std::string* output) const; |
| 150 |
| 151 // Return a string description of what goes in a given bucket. |
| 152 const std::string GetSimpleAsciiBucketRange(Sample sample) const; |
| 153 |
| 154 // Write textual description of the bucket contents (relative to histogram). |
| 155 // Output is the count in the buckets, as well as the percentage. |
| 156 void WriteAsciiBucketValue(Count current, |
| 157 double scaled_sum, |
| 158 std::string* output) const; |
| 159 |
145 private: | 160 private: |
146 const std::string histogram_name_; | 161 const std::string histogram_name_; |
147 int32 flags_; | 162 int32 flags_; |
148 | 163 |
149 DISALLOW_COPY_AND_ASSIGN(HistogramBase); | 164 DISALLOW_COPY_AND_ASSIGN(HistogramBase); |
150 }; | 165 }; |
151 | 166 |
152 } // namespace base | 167 } // namespace base |
153 | 168 |
154 #endif // BASE_METRICS_HISTOGRAM_BASE_H_ | 169 #endif // BASE_METRICS_HISTOGRAM_BASE_H_ |
OLD | NEW |