| 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;
|
| }
|
|
|