| 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_SAMPLES_H_ | 5 #ifndef BASE_METRICS_HISTOGRAM_SAMPLES_H_ |
| 6 #define BASE_METRICS_HISTOGRAM_SAMPLES_H_ | 6 #define BASE_METRICS_HISTOGRAM_SAMPLES_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include "base/atomicops.h" | 11 #include "base/atomicops.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/metrics/histogram_base.h" | 14 #include "base/metrics/histogram_base.h" |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 | 17 |
| 18 class Pickle; | 18 class Pickle; |
| 19 class PickleIterator; | 19 class PickleIterator; |
| 20 class SampleCountIterator; | 20 class SampleCountIterator; |
| 21 | 21 |
| 22 // HistogramSamples is a container storing all samples of a histogram. All | 22 // HistogramSamples is a container storing all samples of a histogram. All |
| 23 // elements must be of a fixed width to ensure 32/64-bit interoperability. | 23 // elements must be of a fixed width to ensure 32/64-bit interoperability. |
| 24 // If this structure changes, bump the version number for kTypeIdHistogram | 24 // If this structure changes, bump the version number for kTypeIdHistogram |
| 25 // in histogram_persistence.cc. | 25 // in persistent_histogram_allocator.cc. |
| 26 class BASE_EXPORT HistogramSamples { | 26 class BASE_EXPORT HistogramSamples { |
| 27 public: | 27 public: |
| 28 struct Metadata { | 28 struct Metadata { |
| 29 // Initialized when the sample-set is first created with a value provided | 29 // Initialized when the sample-set is first created with a value provided |
| 30 // by the caller. It is generally used to identify the sample-set across | 30 // by the caller. It is generally used to identify the sample-set across |
| 31 // threads and processes, though not necessarily uniquely as it is possible | 31 // threads and processes, though not necessarily uniquely as it is possible |
| 32 // to have multiple sample-sets representing subsets of the data. | 32 // to have multiple sample-sets representing subsets of the data. |
| 33 uint64_t id; | 33 uint64_t id; |
| 34 | 34 |
| 35 // The sum of all the entries, effectivly the sum(sample * count) for | 35 // The sum of all the entries, effectivly the sum(sample * count) for |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 // Get the index of current histogram bucket. | 113 // Get the index of current histogram bucket. |
| 114 // For histograms that don't use predefined buckets, it returns false. | 114 // For histograms that don't use predefined buckets, it returns false. |
| 115 // Requires: !Done(); | 115 // Requires: !Done(); |
| 116 virtual bool GetBucketIndex(size_t* index) const; | 116 virtual bool GetBucketIndex(size_t* index) const; |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 } // namespace base | 119 } // namespace base |
| 120 | 120 |
| 121 #endif // BASE_METRICS_HISTOGRAM_SAMPLES_H_ | 121 #endif // BASE_METRICS_HISTOGRAM_SAMPLES_H_ |
| OLD | NEW |