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

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

Issue 11829032: Add a histogram for renderer memory usage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 11 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
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 8
9 // It supports calls to accumulate either time intervals (which are processed 9 // It supports calls to accumulate either time intervals (which are processed
10 // as integral number of milliseconds), or arbitrary integral units. 10 // as integral number of milliseconds), or arbitrary integral units.
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 // Support histograming of an enumerated value. Samples should be one of the 210 // Support histograming of an enumerated value. Samples should be one of the
211 // std::vector<int> list provided via |custom_ranges|. See comments above 211 // std::vector<int> list provided via |custom_ranges|. See comments above
212 // CustomRanges::FactoryGet about the requirement of |custom_ranges|. 212 // CustomRanges::FactoryGet about the requirement of |custom_ranges|.
213 // You can use the helper function CustomHistogram::ArrayToCustomRanges to 213 // You can use the helper function CustomHistogram::ArrayToCustomRanges to
214 // transform a C-style array of valid sample values to a std::vector<int>. 214 // transform a C-style array of valid sample values to a std::vector<int>.
215 #define HISTOGRAM_CUSTOM_ENUMERATION(name, sample, custom_ranges) \ 215 #define HISTOGRAM_CUSTOM_ENUMERATION(name, sample, custom_ranges) \
216 STATIC_HISTOGRAM_POINTER_BLOCK(name, Add(sample), \ 216 STATIC_HISTOGRAM_POINTER_BLOCK(name, Add(sample), \
217 base::CustomHistogram::FactoryGet(name, custom_ranges, \ 217 base::CustomHistogram::FactoryGet(name, custom_ranges, \
218 base::HistogramBase::kNoFlags)) 218 base::HistogramBase::kNoFlags))
219 219
220 #define HISTOGRAM_MEMORY_KB(name, sample) HISTOGRAM_CUSTOM_COUNTS( \
jar (doing other things) 2013/01/14 19:41:18 Do you deliberately want a histogram that is not g
marja 2013/01/14 19:42:38 Yes, we deliberately want that. The histogram is o
221 name, sample, 1000, 500000, 50)
222
220 //------------------------------------------------------------------------------ 223 //------------------------------------------------------------------------------
221 // Define Debug vs non-debug flavors of macros. 224 // Define Debug vs non-debug flavors of macros.
222 #ifndef NDEBUG 225 #ifndef NDEBUG
223 226
224 #define DHISTOGRAM_TIMES(name, sample) HISTOGRAM_TIMES(name, sample) 227 #define DHISTOGRAM_TIMES(name, sample) HISTOGRAM_TIMES(name, sample)
225 #define DHISTOGRAM_COUNTS(name, sample) HISTOGRAM_COUNTS(name, sample) 228 #define DHISTOGRAM_COUNTS(name, sample) HISTOGRAM_COUNTS(name, sample)
226 #define DHISTOGRAM_PERCENTAGE(name, under_one_hundred) HISTOGRAM_PERCENTAGE(\ 229 #define DHISTOGRAM_PERCENTAGE(name, under_one_hundred) HISTOGRAM_PERCENTAGE(\
227 name, under_one_hundred) 230 name, under_one_hundred)
228 #define DHISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) \ 231 #define DHISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) \
229 HISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) 232 HISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count)
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 static bool ValidateCustomRanges(const std::vector<Sample>& custom_ranges); 705 static bool ValidateCustomRanges(const std::vector<Sample>& custom_ranges);
703 static BucketRanges* CreateBucketRangesFromCustomRanges( 706 static BucketRanges* CreateBucketRangesFromCustomRanges(
704 const std::vector<Sample>& custom_ranges); 707 const std::vector<Sample>& custom_ranges);
705 708
706 DISALLOW_COPY_AND_ASSIGN(CustomHistogram); 709 DISALLOW_COPY_AND_ASSIGN(CustomHistogram);
707 }; 710 };
708 711
709 } // namespace base 712 } // namespace base
710 713
711 #endif // BASE_METRICS_HISTOGRAM_H_ 714 #endif // BASE_METRICS_HISTOGRAM_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_process_host_impl.cc » ('j') | content/public/common/content_switches.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698