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

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

Issue 484603006: Add LOCAL_ prefix to non-UMA histogram macros. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 6 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
« no previous file with comments | « base/metrics/histogram.h ('k') | base/metrics/histogram_unittest.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 // Histogram is an object that aggregates statistics, and can summarize them in 5 // Histogram is an object that aggregates statistics, and can summarize them in
6 // various forms, including ASCII graphical, HTML, and numerically (as a 6 // various forms, including ASCII graphical, HTML, and numerically (as a
7 // vector of numbers corresponding to each of the aggregating buckets). 7 // vector of numbers corresponding to each of the aggregating buckets).
8 // See header file for details and examples. 8 // See header file for details and examples.
9 9
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 HistogramBase* Histogram::FactoryTimeGet(const string& name, 126 HistogramBase* Histogram::FactoryTimeGet(const string& name,
127 TimeDelta minimum, 127 TimeDelta minimum,
128 TimeDelta maximum, 128 TimeDelta maximum,
129 size_t bucket_count, 129 size_t bucket_count,
130 int32 flags) { 130 int32 flags) {
131 return FactoryGet(name, minimum.InMilliseconds(), maximum.InMilliseconds(), 131 return FactoryGet(name, minimum.InMilliseconds(), maximum.InMilliseconds(),
132 bucket_count, flags); 132 bucket_count, flags);
133 } 133 }
134 134
135 TimeTicks Histogram::DebugNow() {
136 #ifndef NDEBUG
137 return TimeTicks::Now();
138 #else
139 return TimeTicks();
140 #endif
141 }
142
143 // Calculate what range of values are held in each bucket. 135 // Calculate what range of values are held in each bucket.
144 // We have to be careful that we don't pick a ratio between starting points in 136 // We have to be careful that we don't pick a ratio between starting points in
145 // consecutive buckets that is sooo small, that the integer bounds are the same 137 // consecutive buckets that is sooo small, that the integer bounds are the same
146 // (effectively making one bucket get no values). We need to avoid: 138 // (effectively making one bucket get no values). We need to avoid:
147 // ranges(i) == ranges(i + 1) 139 // ranges(i) == ranges(i + 1)
148 // To avoid that, we just do a fine-grained bucket width as far as we need to 140 // To avoid that, we just do a fine-grained bucket width as far as we need to
149 // until we get a ratio that moves us along at least 2 units at a time. From 141 // until we get a ratio that moves us along at least 2 units at a time. From
150 // that bucket onward we do use the exponential growth of buckets. 142 // that bucket onward we do use the exponential growth of buckets.
151 // 143 //
152 // static 144 // static
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 835
844 BucketRanges* bucket_ranges = new BucketRanges(ranges.size()); 836 BucketRanges* bucket_ranges = new BucketRanges(ranges.size());
845 for (size_t i = 0; i < ranges.size(); i++) { 837 for (size_t i = 0; i < ranges.size(); i++) {
846 bucket_ranges->set_range(i, ranges[i]); 838 bucket_ranges->set_range(i, ranges[i]);
847 } 839 }
848 bucket_ranges->ResetChecksum(); 840 bucket_ranges->ResetChecksum();
849 return bucket_ranges; 841 return bucket_ranges;
850 } 842 }
851 843
852 } // namespace base 844 } // namespace base
OLDNEW
« no previous file with comments | « base/metrics/histogram.h ('k') | base/metrics/histogram_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698