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

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

Issue 8520018: Add OVERRIDE to base/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: extra header Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « base/metrics/histogram.h ('k') | base/process_util.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_STATS_COUNTERS_H_ 5 #ifndef BASE_METRICS_STATS_COUNTERS_H_
6 #define BASE_METRICS_STATS_COUNTERS_H_ 6 #define BASE_METRICS_STATS_COUNTERS_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/base_export.h" 11 #include "base/base_export.h"
12 #include "base/compiler_specific.h"
12 #include "base/metrics/stats_table.h" 13 #include "base/metrics/stats_table.h"
13 #include "base/time.h" 14 #include "base/time.h"
14 15
15 namespace base { 16 namespace base {
16 17
17 // StatsCounters are dynamically created values which can be tracked in 18 // StatsCounters are dynamically created values which can be tracked in
18 // the StatsTable. They are designed to be lightweight to create and 19 // the StatsTable. They are designed to be lightweight to create and
19 // easy to use. 20 // easy to use.
20 // 21 //
21 // Since StatsCounters can be created dynamically by name, there is 22 // Since StatsCounters can be created dynamically by name, there is
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 158
158 // A StatsRate is a timer that keeps a count of the number of intervals added so 159 // A StatsRate is a timer that keeps a count of the number of intervals added so
159 // that several statistics can be produced: 160 // that several statistics can be produced:
160 // min, max, avg, count, total 161 // min, max, avg, count, total
161 class BASE_EXPORT StatsRate : public StatsCounterTimer { 162 class BASE_EXPORT StatsRate : public StatsCounterTimer {
162 public: 163 public:
163 // Constructs and starts the timer. 164 // Constructs and starts the timer.
164 explicit StatsRate(const std::string& name); 165 explicit StatsRate(const std::string& name);
165 virtual ~StatsRate(); 166 virtual ~StatsRate();
166 167
167 virtual void Add(int value); 168 virtual void Add(int value) OVERRIDE;
168 169
169 private: 170 private:
170 StatsCounter counter_; 171 StatsCounter counter_;
171 StatsCounter largest_add_; 172 StatsCounter largest_add_;
172 }; 173 };
173 174
174 175
175 // Helper class for scoping a timer or rate. 176 // Helper class for scoping a timer or rate.
176 template<class T> class StatsScope { 177 template<class T> class StatsScope {
177 public: 178 public:
(...skipping 10 matching lines...) Expand all
188 timer_.Stop(); 189 timer_.Stop();
189 } 190 }
190 191
191 private: 192 private:
192 T& timer_; 193 T& timer_;
193 }; 194 };
194 195
195 } // namespace base 196 } // namespace base
196 197
197 #endif // BASE_METRICS_STATS_COUNTERS_H_ 198 #endif // BASE_METRICS_STATS_COUNTERS_H_
OLDNEW
« no previous file with comments | « base/metrics/histogram.h ('k') | base/process_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698