OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // Histogram is an object that aggregates statistics, and can summarize them in | 5 // Histogram is an object that aggregates statistics, and can summarize them in |
6 // various forms, including ASCII graphical, HTML, and numerically (as a | 6 // various forms, including ASCII graphical, HTML, and numerically (as a |
7 // vector of numbers corresponding to each of the aggregating buckets). | 7 // vector of numbers corresponding to each of the aggregating buckets). |
8 | 8 |
9 // It supports calls to accumulate either time intervals (which are processed | 9 // It supports calls to accumulate either time intervals (which are processed |
10 // as integral number of milliseconds), or arbitrary integral units. | 10 // as integral number of milliseconds), or arbitrary integral units. |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 // accumulates the browser-side shadow copy of histograms (that mirror | 291 // accumulates the browser-side shadow copy of histograms (that mirror |
292 // histograms created in the renderer). | 292 // histograms created in the renderer). |
293 | 293 |
294 // Serialize the given snapshot of a Histogram into a String. Uses | 294 // Serialize the given snapshot of a Histogram into a String. Uses |
295 // Pickle class to flatten the object. | 295 // Pickle class to flatten the object. |
296 static std::string SerializeHistogramInfo(const Histogram& histogram, | 296 static std::string SerializeHistogramInfo(const Histogram& histogram, |
297 const SampleSet& snapshot); | 297 const SampleSet& snapshot); |
298 // The following method accepts a list of pickled histograms and | 298 // The following method accepts a list of pickled histograms and |
299 // builds a histogram and updates shadow copy of histogram data in the | 299 // builds a histogram and updates shadow copy of histogram data in the |
300 // browser process. | 300 // browser process. |
301 static void DeserializeHistogramList( | 301 static bool DeserializeHistogramInfo(const std::string& histogram_info); |
302 const std::vector<std::string>& histograms); | |
303 static bool DeserializeHistogramInfo(const std::string& state); | |
304 | 302 |
305 | 303 |
306 //---------------------------------------------------------------------------- | 304 //---------------------------------------------------------------------------- |
307 // Accessors for serialization and testing. | 305 // Accessors for serialization and testing. |
308 //---------------------------------------------------------------------------- | 306 //---------------------------------------------------------------------------- |
309 const std::string histogram_name() const { return histogram_name_; } | 307 const std::string histogram_name() const { return histogram_name_; } |
310 Sample declared_min() const { return declared_min_; } | 308 Sample declared_min() const { return declared_min_; } |
311 Sample declared_max() const { return declared_max_; } | 309 Sample declared_max() const { return declared_max_; } |
312 virtual Sample ranges(size_t i) const { return ranges_[i];} | 310 virtual Sample ranges(size_t i) const { return ranges_[i];} |
313 virtual size_t bucket_count() const { return bucket_count_; } | 311 virtual size_t bucket_count() const { return bucket_count_; } |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 // lock protects access to the above map. | 547 // lock protects access to the above map. |
550 static Lock* lock_; | 548 static Lock* lock_; |
551 | 549 |
552 // Dump all known histograms to log. | 550 // Dump all known histograms to log. |
553 static bool dump_on_exit_; | 551 static bool dump_on_exit_; |
554 | 552 |
555 DISALLOW_COPY_AND_ASSIGN(StatisticsRecorder); | 553 DISALLOW_COPY_AND_ASSIGN(StatisticsRecorder); |
556 }; | 554 }; |
557 | 555 |
558 #endif // BASE_HISTOGRAM_H_ | 556 #endif // BASE_HISTOGRAM_H_ |
OLD | NEW |