Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: base/metrics/sparse_histogram.h

Issue 1471073007: Reorganize histograms for persistence. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shmem-alloc
Patch Set: addressed review comments by Alexei Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/metrics/sample_vector_unittest.cc ('k') | base/metrics/sparse_histogram.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 19 matching lines...) Expand all
30 30
31 class BASE_EXPORT SparseHistogram : public HistogramBase { 31 class BASE_EXPORT SparseHistogram : public HistogramBase {
32 public: 32 public:
33 // If there's one with same name, return the existing one. If not, create a 33 // If there's one with same name, return the existing one. If not, create a
34 // new one. 34 // new one.
35 static HistogramBase* FactoryGet(const std::string& name, int32 flags); 35 static HistogramBase* FactoryGet(const std::string& name, int32 flags);
36 36
37 ~SparseHistogram() override; 37 ~SparseHistogram() override;
38 38
39 // HistogramBase implementation: 39 // HistogramBase implementation:
40 uint64_t name_hash() const override;
40 HistogramType GetHistogramType() const override; 41 HistogramType GetHistogramType() const override;
41 bool HasConstructionArguments(Sample expected_minimum, 42 bool HasConstructionArguments(Sample expected_minimum,
42 Sample expected_maximum, 43 Sample expected_maximum,
43 size_t expected_bucket_count) const override; 44 size_t expected_bucket_count) const override;
44 void Add(Sample value) override; 45 void Add(Sample value) override;
45 void AddCount(Sample value, int count) override; 46 void AddCount(Sample value, int count) override;
46 void AddSamples(const HistogramSamples& samples) override; 47 void AddSamples(const HistogramSamples& samples) override;
47 bool AddSamplesFromPickle(base::PickleIterator* iter) override; 48 bool AddSamplesFromPickle(base::PickleIterator* iter) override;
48 scoped_ptr<HistogramSamples> SnapshotSamples() const override; 49 scoped_ptr<HistogramSamples> SnapshotSamples() const override;
49 void WriteHTMLGraph(std::string* output) const override; 50 void WriteHTMLGraph(std::string* output) const override;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 mutable base::Lock lock_; 83 mutable base::Lock lock_;
83 84
84 SampleMap samples_; 85 SampleMap samples_;
85 86
86 DISALLOW_COPY_AND_ASSIGN(SparseHistogram); 87 DISALLOW_COPY_AND_ASSIGN(SparseHistogram);
87 }; 88 };
88 89
89 } // namespace base 90 } // namespace base
90 91
91 #endif // BASE_METRICS_SPARSE_HISTOGRAM_H_ 92 #endif // BASE_METRICS_SPARSE_HISTOGRAM_H_
OLDNEW
« no previous file with comments | « base/metrics/sample_vector_unittest.cc ('k') | base/metrics/sparse_histogram.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698