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

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

Issue 1256363002: Add support to increase a UMA histogram bucket by an aribitrary integer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Handling negative counts in sparse histograms. Created 5 years, 4 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
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_HISTOGRAM_BASE_H_ 5 #ifndef BASE_METRICS_HISTOGRAM_BASE_H_
6 #define BASE_METRICS_HISTOGRAM_BASE_H_ 6 #define BASE_METRICS_HISTOGRAM_BASE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 virtual HistogramType GetHistogramType() const = 0; 113 virtual HistogramType GetHistogramType() const = 0;
114 114
115 // Whether the histogram has construction arguments as parameters specified. 115 // Whether the histogram has construction arguments as parameters specified.
116 // For histograms that don't have the concept of minimum, maximum or 116 // For histograms that don't have the concept of minimum, maximum or
117 // bucket_count, this function always returns false. 117 // bucket_count, this function always returns false.
118 virtual bool HasConstructionArguments(Sample expected_minimum, 118 virtual bool HasConstructionArguments(Sample expected_minimum,
119 Sample expected_maximum, 119 Sample expected_maximum,
120 size_t expected_bucket_count) const = 0; 120 size_t expected_bucket_count) const = 0;
121 121
122 virtual void Add(Sample value) = 0; 122 virtual void Add(Sample value) = 0;
123 // In Add function the |value| bucket is increased by one, but in some use
Alexei Svitkine (slow) 2015/08/03 18:15:42 Add a blank line before.
amohammadkhan 2015/08/04 18:22:51 Done.
124 // cases we need to increase this value by an arbitrary integer. AddCount
125 // function increases the |value| bucket by |count|.
126 virtual void AddCount(Sample value, int count) = 0;
123 127
124 // 2 convenient functions that call Add(Sample). 128 // 2 convenient functions that call Add(Sample).
125 void AddTime(const TimeDelta& time); 129 void AddTime(const TimeDelta& time);
126 void AddBoolean(bool value); 130 void AddBoolean(bool value);
127 131
128 virtual void AddSamples(const HistogramSamples& samples) = 0; 132 virtual void AddSamples(const HistogramSamples& samples) = 0;
129 virtual bool AddSamplesFromPickle(base::PickleIterator* iter) = 0; 133 virtual bool AddSamplesFromPickle(base::PickleIterator* iter) = 0;
130 134
131 // Serialize the histogram info into |pickle|. 135 // Serialize the histogram info into |pickle|.
132 // Note: This only serializes the construction arguments of the histogram, but 136 // Note: This only serializes the construction arguments of the histogram, but
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 private: 189 private:
186 const std::string histogram_name_; 190 const std::string histogram_name_;
187 int32_t flags_; 191 int32_t flags_;
188 192
189 DISALLOW_COPY_AND_ASSIGN(HistogramBase); 193 DISALLOW_COPY_AND_ASSIGN(HistogramBase);
190 }; 194 };
191 195
192 } // namespace base 196 } // namespace base
193 197
194 #endif // BASE_METRICS_HISTOGRAM_BASE_H_ 198 #endif // BASE_METRICS_HISTOGRAM_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698