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

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

Issue 13469020: Implement write methods for SparseHistogram (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase due to conflict in histogram_base.cc Created 7 years, 8 months 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/histogram_base.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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 explicit SparseHistogram(const std::string& name); 83 explicit SparseHistogram(const std::string& name);
84 84
85 friend BASE_EXPORT_PRIVATE HistogramBase* DeserializeHistogramInfo( 85 friend BASE_EXPORT_PRIVATE HistogramBase* DeserializeHistogramInfo(
86 PickleIterator* iter); 86 PickleIterator* iter);
87 static HistogramBase* DeserializeInfoImpl(PickleIterator* iter); 87 static HistogramBase* DeserializeInfoImpl(PickleIterator* iter);
88 88
89 virtual void GetParameters(DictionaryValue* params) const OVERRIDE; 89 virtual void GetParameters(DictionaryValue* params) const OVERRIDE;
90 virtual void GetCountAndBucketData(Count* count, 90 virtual void GetCountAndBucketData(Count* count,
91 ListValue* buckets) const OVERRIDE; 91 ListValue* buckets) const OVERRIDE;
92 92
93 // Helpers for emitting Ascii graphic. Each method appends data to output.
94 void WriteAsciiImpl(bool graph_it,
95 const std::string& newline,
96 std::string* output) const;
97
98 // Write a common header message describing this histogram.
99 void WriteAsciiHeader(const Count total_count,
100 std::string* output) const;
101
93 // For constuctor calling. 102 // For constuctor calling.
94 friend class SparseHistogramTest; 103 friend class SparseHistogramTest;
95 104
96 // Protects access to |samples_|. 105 // Protects access to |samples_|.
97 mutable base::Lock lock_; 106 mutable base::Lock lock_;
98 107
99 SampleMap samples_; 108 SampleMap samples_;
100 109
101 DISALLOW_COPY_AND_ASSIGN(SparseHistogram); 110 DISALLOW_COPY_AND_ASSIGN(SparseHistogram);
102 }; 111 };
103 112
104 } // namespace base 113 } // namespace base
105 114
106 #endif // BASE_METRICS_SPARSE_HISTOGRAM_H_ 115 #endif // BASE_METRICS_SPARSE_HISTOGRAM_H_
OLDNEW
« no previous file with comments | « base/metrics/histogram_base.cc ('k') | base/metrics/sparse_histogram.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698