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

Unified Diff: base/metrics/histogram.cc

Issue 1195473002: Optimize size of UMA histogram macros. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/metrics/histogram.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram.cc
diff --git a/base/metrics/histogram.cc b/base/metrics/histogram.cc
index 0a14f223a960fea5f9bfb2ae96e9f60ef1a4e07d..7dfb552844ded907299cbe120b64042c5819bdd1 100644
--- a/base/metrics/histogram.cc
+++ b/base/metrics/histogram.cc
@@ -131,6 +131,23 @@ HistogramBase* Histogram::FactoryTimeGet(const std::string& name,
flags);
}
+HistogramBase* Histogram::FactoryGet(const char* name,
+ Sample minimum,
+ Sample maximum,
+ size_t bucket_count,
+ int32 flags) {
+ return FactoryGet(std::string(name), minimum, maximum, bucket_count, flags);
+}
+
+HistogramBase* Histogram::FactoryTimeGet(const char* name,
+ TimeDelta minimum,
+ TimeDelta maximum,
+ size_t bucket_count,
+ int32 flags) {
+ return FactoryTimeGet(std::string(name), minimum, maximum, bucket_count,
+ flags);
+}
+
// Calculate what range of values are held in each bucket.
// We have to be careful that we don't pick a ratio between starting points in
// consecutive buckets that is sooo small, that the integer bounds are the same
@@ -532,6 +549,23 @@ HistogramBase* LinearHistogram::FactoryTimeGet(const std::string& name,
flags);
}
+HistogramBase* LinearHistogram::FactoryGet(const char* name,
+ Sample minimum,
+ Sample maximum,
+ size_t bucket_count,
+ int32 flags) {
+ return FactoryGet(std::string(name), minimum, maximum, bucket_count, flags);
+}
+
+HistogramBase* LinearHistogram::FactoryTimeGet(const char* name,
+ TimeDelta minimum,
+ TimeDelta maximum,
+ size_t bucket_count,
+ int32 flags) {
+ return FactoryTimeGet(std::string(name), minimum, maximum, bucket_count,
+ flags);
+}
+
HistogramBase* LinearHistogram::FactoryGetWithRangeDescription(
const std::string& name,
Sample minimum,
@@ -677,6 +711,10 @@ HistogramBase* BooleanHistogram::FactoryGet(const std::string& name,
return histogram;
}
+HistogramBase* BooleanHistogram::FactoryGet(const char* name, int32 flags) {
+ return FactoryGet(std::string(name), flags);
+}
+
HistogramType BooleanHistogram::GetHistogramType() const {
return BOOLEAN_HISTOGRAM;
}
@@ -737,6 +775,13 @@ HistogramBase* CustomHistogram::FactoryGet(
return histogram;
}
+HistogramBase* CustomHistogram::FactoryGet(
+ const char* name,
+ const std::vector<Sample>& custom_ranges,
+ int32 flags) {
+ return FactoryGet(std::string(name), custom_ranges, flags);
+}
+
HistogramType CustomHistogram::GetHistogramType() const {
return CUSTOM_HISTOGRAM;
}
« no previous file with comments | « base/metrics/histogram.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698