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

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

Issue 6410105: run iwyu on base! Base URL: svn://svn.chromium.org/chrome/trunk/src/base
Patch Set: Created 9 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « base/metrics/histogram.cc ('k') | base/metrics/stats_table.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include <stddef.h>
6 #include <string>
7
5 #include "base/metrics/stats_counters.h" 8 #include "base/metrics/stats_counters.h"
9 #include "base/metrics/stats_table.h"
10 #include "base/time.h"
6 11
7 namespace base { 12 namespace base {
8 13
9 StatsCounter::StatsCounter(const std::string& name) 14 StatsCounter::StatsCounter(const std::string& name)
10 : counter_id_(-1) { 15 : counter_id_(-1) {
11 // We prepend the name with 'c:' to indicate that it is a counter. 16 // We prepend the name with 'c:' to indicate that it is a counter.
12 name_ = "c:"; 17 name_ = "c:";
13 name_.append(name); 18 name_.append(name);
14 } 19 }
15 20
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } 113 }
109 114
110 void StatsRate::Add(int value) { 115 void StatsRate::Add(int value) {
111 counter_.Increment(); 116 counter_.Increment();
112 StatsCounterTimer::Add(value); 117 StatsCounterTimer::Add(value);
113 if (value > largest_add_.value()) 118 if (value > largest_add_.value())
114 largest_add_.Set(value); 119 largest_add_.Set(value);
115 } 120 }
116 121
117 } // namespace base 122 } // namespace base
OLDNEW
« no previous file with comments | « base/metrics/histogram.cc ('k') | base/metrics/stats_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698