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 <limits.h> | 8 #include <limits.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
153 bool SerializeInfo(base::Pickle* pickle) const; | 153 bool SerializeInfo(base::Pickle* pickle) const; |
154 | 154 |
155 // Try to find out data corruption from histogram and the samples. | 155 // Try to find out data corruption from histogram and the samples. |
156 // The returned value is a combination of Inconsistency enum. | 156 // The returned value is a combination of Inconsistency enum. |
157 virtual int FindCorruption(const HistogramSamples& samples) const; | 157 virtual int FindCorruption(const HistogramSamples& samples) const; |
158 | 158 |
159 // Snapshot the current complete set of sample data. | 159 // Snapshot the current complete set of sample data. |
160 // Override with atomic/locked snapshot if needed. | 160 // Override with atomic/locked snapshot if needed. |
161 virtual scoped_ptr<HistogramSamples> SnapshotSamples() const = 0; | 161 virtual scoped_ptr<HistogramSamples> SnapshotSamples() const = 0; |
162 | 162 |
163 // Calculate delta from the previous call to this method. | |
Alexei Svitkine (slow)
2016/02/09 19:46:51
I don't think the comment is sufficiently clear. P
bcwhite
2016/02/11 16:42:38
Done.
| |
164 virtual scoped_ptr<HistogramSamples> SnapshotDelta() = 0; | |
165 | |
163 // The following methods provide graphical histogram displays. | 166 // The following methods provide graphical histogram displays. |
164 virtual void WriteHTMLGraph(std::string* output) const = 0; | 167 virtual void WriteHTMLGraph(std::string* output) const = 0; |
165 virtual void WriteAscii(std::string* output) const = 0; | 168 virtual void WriteAscii(std::string* output) const = 0; |
166 | 169 |
167 // Produce a JSON representation of the histogram. This is implemented with | 170 // Produce a JSON representation of the histogram. This is implemented with |
168 // the help of GetParameters and GetCountAndBucketData; overwrite them to | 171 // the help of GetParameters and GetCountAndBucketData; overwrite them to |
169 // customize the output. | 172 // customize the output. |
170 void WriteJSON(std::string* output) const; | 173 void WriteJSON(std::string* output) const; |
171 | 174 |
172 protected: | 175 protected: |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
204 private: | 207 private: |
205 const std::string histogram_name_; | 208 const std::string histogram_name_; |
206 AtomicCount flags_; | 209 AtomicCount flags_; |
207 | 210 |
208 DISALLOW_COPY_AND_ASSIGN(HistogramBase); | 211 DISALLOW_COPY_AND_ASSIGN(HistogramBase); |
209 }; | 212 }; |
210 | 213 |
211 } // namespace base | 214 } // namespace base |
212 | 215 |
213 #endif // BASE_METRICS_HISTOGRAM_BASE_H_ | 216 #endif // BASE_METRICS_HISTOGRAM_BASE_H_ |
OLD | NEW |