Home | History | Annotate | Download | only in metrics

Lines Matching refs:Histogram

5 // Histogram is an object that aggregates statistics, and can summarize them in
10 #include "base/metrics/histogram.h"
48 DLOG(ERROR) << "Pickle error decoding Histogram: " << *histogram_name;
53 // checks above and beyond those in Histogram::Initialize()
59 DLOG(ERROR) << "Values error decoding Histogram: " << histogram_name;
63 // We use the arguments to find or create the local version of the histogram
71 bool ValidateRangeChecksum(const HistogramBase& histogram,
73 const Histogram& casted_histogram =
74 static_cast<const Histogram&>(histogram);
85 const size_t Histogram::kBucketCount_MAX = 16384u;
87 HistogramBase* Histogram::FactoryGet(const string& name,
96 HistogramBase* histogram = StatisticsRecorder::FindHistogram(name);
97 if (!histogram) {
104 Histogram* tentative_histogram =
105 new Histogram(name, minimum, maximum, registered_ranges);
108 histogram =
112 DCHECK_EQ(HISTOGRAM, histogram->GetHistogramType());
113 if (!histogram->HasConstructionArguments(minimum, maximum, bucket_count)) {
114 // The construction arguments do not match the existing histogram. This can
120 DLOG(ERROR) << "Histogram " << name << " has bad construction arguments";
123 return histogram;
126 HistogramBase* Histogram::FactoryTimeGet(const string& name,
145 void Histogram::InitializeBucketRanges(Sample minimum,
175 const int Histogram::kCommonRaceBasedCountMismatch = 5;
177 int Histogram::FindCorruption(const HistogramSamples& samples) const {
196 UMA_HISTOGRAM_COUNTS("Histogram.InconsistentCountHigh", delta);
201 UMA_HISTOGRAM_COUNTS("Histogram.InconsistentCountLow", -delta);
209 Sample Histogram::ranges(size_t i) const {
213 size_t Histogram::bucket_count() const {
218 bool Histogram::InspectConstructionArguments(const string& name,
224 DVLOG(1) << "Histogram: " << name << " has bad minimum: " << *minimum;
228 DVLOG(1) << "Histogram: " << name << " has bad maximum: " << *maximum;
232 DVLOG(1) << "Histogram: " << name << " has bad bucket_count: "
246 HistogramType Histogram::GetHistogramType() const {
247 return HISTOGRAM;
250 bool Histogram::HasConstructionArguments(Sample expected_minimum,
258 void Histogram::Add(int value) {
269 scoped_ptr<HistogramSamples> Histogram::SnapshotSamples() const {
273 void Histogram::AddSamples(const HistogramSamples& samples) {
277 bool Histogram::AddSamplesFromPickle(PickleIterator* iter) {
281 // The following methods provide a graphical histogram display.
282 void Histogram::WriteHTMLGraph(string* output) const {
289 void Histogram::WriteAscii(string* output) const {
293 bool Histogram::SerializeInfoImpl(Pickle* pickle) const {
303 Histogram::Histogram(const string& name,
315 Histogram::~Histogram() {
318 bool Histogram::PrintEmptyBucket(size_t index) const {
322 // Use the actual bucket widths (like a linear histogram) until the widths get
327 double Histogram::GetBucketSize(Count current, size_t i) const {
336 const string Histogram::GetAsciiBucketRange(size_t i) const {
344 HistogramBase* Histogram::DeserializeInfoImpl(PickleIterator* iter) {
357 // Find or create the local version of the histogram in this process.
358 HistogramBase* histogram = Histogram::FactoryGet(
361 if (!ValidateRangeChecksum(*histogram, range_checksum)) {
362 // The serialized histogram might be corrupted.
365 return histogram;
368 scoped_ptr<SampleVector> Histogram::SnapshotSampleVector() const {
374 void Histogram::WriteAsciiImpl(bool graph_it,
391 // nearly the largest bucket range without sliding over the histogram.
411 // Output the actual histogram graph.
441 double Histogram::GetPeakBucketSize(const SampleVector& samples) const {
451 void Histogram::WriteAsciiHeader(const SampleVector& samples,
455 "Histogram: %s recorded %d samples",
469 void Histogram::WriteAsciiBucketContext(const int64 past,
482 void Histogram::GetParameters(DictionaryValue* params) const {
489 void Histogram::GetCountAndBucketData(Count* count,
511 // LinearHistogram: This histogram uses a traditional set of evenly spaced
542 bool valid_arguments = Histogram::InspectConstructionArguments(
546 HistogramBase* histogram = StatisticsRecorder::FindHistogram(name);
547 if (!histogram) {
566 histogram =
570 DCHECK_EQ(LINEAR_HISTOGRAM, histogram->GetHistogramType());
571 if (!histogram->HasConstructionArguments(minimum, maximum, bucket_count)) {
572 // The construction arguments do not match the existing histogram. This can
578 DLOG(ERROR) << "Histogram " << name << " has bad construction arguments";
581 return histogram;
592 : Histogram(name, minimum, maximum, ranges) {
598 // samples in a histogram if we didn't normalize this way.
607 return Histogram::GetAsciiBucketRange(i);
645 HistogramBase* histogram = LinearHistogram::FactoryGet(
647 if (!ValidateRangeChecksum(*histogram, range_checksum)) {
648 // The serialized histogram might be corrupted.
651 return histogram;
659 HistogramBase* histogram = StatisticsRecorder::FindHistogram(name);
660 if (!histogram) {
671 histogram =
675 DCHECK_EQ(BOOLEAN_HISTOGRAM, histogram->GetHistogramType());
676 return histogram;
700 HistogramBase* histogram = BooleanHistogram::FactoryGet(
702 if (!ValidateRangeChecksum(*histogram, range_checksum)) {
703 // The serialized histogram might be corrupted.
706 return histogram;
718 HistogramBase* histogram = StatisticsRecorder::FindHistogram(name);
719 if (!histogram) {
730 histogram =
734 DCHECK_EQ(histogram->GetHistogramType(), CUSTOM_HISTOGRAM);
735 return histogram;
759 : Histogram(name,
765 if (!Histogram::SerializeInfoImpl(pickle))
803 HistogramBase* histogram = CustomHistogram::FactoryGet(
805 if (!ValidateRangeChecksum(*histogram, range_checksum)) {
806 // The serialized histogram might be corrupted.
809 return histogram;