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

Unified Diff: base/metrics/histogram.cc

Issue 6975027: Add metrics for DHCP WPAD feature. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments. Created 9 years, 7 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') | net/base/net_errors.h » ('j') | 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 4262853a80fd65c322c04da55bb8ef766df77a93..6fd30be87ab8d8da79163fb7ab10d53e42f0d553 100644
--- a/base/metrics/histogram.cc
+++ b/base/metrics/histogram.cc
@@ -940,6 +940,21 @@ Histogram::ClassType CustomHistogram::histogram_type() const {
return CUSTOM_HISTOGRAM;
}
+// static
+std::vector<Histogram::Sample> CustomHistogram::ArrayToCustomRanges(
+ const Sample* values, size_t num_values) {
+ std::vector<Sample> all_values;
+ for (size_t i = 0; i < num_values; ++i) {
+ Sample value = values[i];
+ all_values.push_back(value);
+
+ // Ensure that a guard bucket is added. If we end up with duplicate
+ // values, FactoryGet will take care of removing them.
+ all_values.push_back(value + 1);
+ }
+ return all_values;
+}
+
CustomHistogram::CustomHistogram(const std::string& name,
const std::vector<Sample>& custom_ranges)
: Histogram(name, custom_ranges[1], custom_ranges.back(),
« no previous file with comments | « base/metrics/histogram.h ('k') | net/base/net_errors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698