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_SPARSE_HISTOGRAM_H_ | 5 #ifndef BASE_METRICS_SPARSE_HISTOGRAM_H_ |
6 #define BASE_METRICS_SPARSE_HISTOGRAM_H_ | 6 #define BASE_METRICS_SPARSE_HISTOGRAM_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 uint64_t name_hash() const override; | 64 uint64_t name_hash() const override; |
65 HistogramType GetHistogramType() const override; | 65 HistogramType GetHistogramType() const override; |
66 bool HasConstructionArguments(Sample expected_minimum, | 66 bool HasConstructionArguments(Sample expected_minimum, |
67 Sample expected_maximum, | 67 Sample expected_maximum, |
68 uint32_t expected_bucket_count) const override; | 68 uint32_t expected_bucket_count) const override; |
69 void Add(Sample value) override; | 69 void Add(Sample value) override; |
70 void AddCount(Sample value, int count) override; | 70 void AddCount(Sample value, int count) override; |
71 void AddSamples(const HistogramSamples& samples) override; | 71 void AddSamples(const HistogramSamples& samples) override; |
72 bool AddSamplesFromPickle(base::PickleIterator* iter) override; | 72 bool AddSamplesFromPickle(base::PickleIterator* iter) override; |
73 scoped_ptr<HistogramSamples> SnapshotSamples() const override; | 73 scoped_ptr<HistogramSamples> SnapshotSamples() const override; |
| 74 scoped_ptr<HistogramSamples> SnapshotDelta() override; |
74 void WriteHTMLGraph(std::string* output) const override; | 75 void WriteHTMLGraph(std::string* output) const override; |
75 void WriteAscii(std::string* output) const override; | 76 void WriteAscii(std::string* output) const override; |
76 | 77 |
77 protected: | 78 protected: |
78 // HistogramBase implementation: | 79 // HistogramBase implementation: |
79 bool SerializeInfoImpl(base::Pickle* pickle) const override; | 80 bool SerializeInfoImpl(base::Pickle* pickle) const override; |
80 | 81 |
81 private: | 82 private: |
82 // Clients should always use FactoryGet to create SparseHistogram. | 83 // Clients should always use FactoryGet to create SparseHistogram. |
83 explicit SparseHistogram(const std::string& name); | 84 explicit SparseHistogram(const std::string& name); |
(...skipping 16 matching lines...) Expand all Loading... |
100 void WriteAsciiHeader(const Count total_count, | 101 void WriteAsciiHeader(const Count total_count, |
101 std::string* output) const; | 102 std::string* output) const; |
102 | 103 |
103 // For constuctor calling. | 104 // For constuctor calling. |
104 friend class SparseHistogramTest; | 105 friend class SparseHistogramTest; |
105 | 106 |
106 // Protects access to |samples_|. | 107 // Protects access to |samples_|. |
107 mutable base::Lock lock_; | 108 mutable base::Lock lock_; |
108 | 109 |
109 SampleMap samples_; | 110 SampleMap samples_; |
| 111 SampleMap logged_samples_; |
110 | 112 |
111 DISALLOW_COPY_AND_ASSIGN(SparseHistogram); | 113 DISALLOW_COPY_AND_ASSIGN(SparseHistogram); |
112 }; | 114 }; |
113 | 115 |
114 } // namespace base | 116 } // namespace base |
115 | 117 |
116 #endif // BASE_METRICS_SPARSE_HISTOGRAM_H_ | 118 #endif // BASE_METRICS_SPARSE_HISTOGRAM_H_ |
OLD | NEW |