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

Unified Diff: base/metrics/histogram.cc

Issue 1641513004: Update //base to chromium 9659b08ea5a34f889dc4166217f438095ddc10d2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/metrics/histogram.h ('k') | base/metrics/histogram_base.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 15504205e87e8db89e2d5d77fe8bd75c5e310a92..0c9fcb7fa5435b09c9814deb33b4f4241067753c 100644
--- a/base/metrics/histogram.cc
+++ b/base/metrics/histogram.cc
@@ -17,6 +17,7 @@
#include "base/compiler_specific.h"
#include "base/debug/alias.h"
#include "base/logging.h"
+#include "base/metrics/histogram_macros.h"
#include "base/metrics/sample_vector.h"
#include "base/metrics/statistics_recorder.h"
#include "base/pickle.h"
@@ -130,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
@@ -262,6 +280,8 @@ void Histogram::Add(int value) {
if (value < 0)
value = 0;
samples_->Accumulate(value, 1);
+
+ FindAndRunCallback(value);
}
scoped_ptr<HistogramSamples> Histogram::SnapshotSamples() const {
@@ -531,6 +551,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,
@@ -676,6 +713,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;
}
@@ -736,6 +777,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') | base/metrics/histogram_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698