Lines Matching full: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,
135 TimeTicks Histogram::DebugNow() {
153 void Histogram::InitializeBucketRanges(Sample minimum,
183 const int Histogram::kCommonRaceBasedCountMismatch = 5;
185 int Histogram::FindCorruption(const HistogramSamples& samples) const {
204 UMA_HISTOGRAM_COUNTS("Histogram.InconsistentCountHigh", delta);
209 UMA_HISTOGRAM_COUNTS("Histogram.InconsistentCountLow", -delta);
217 Sample Histogram::ranges(size_t i) const {
221 size_t Histogram::bucket_count() const {
226 bool Histogram::InspectConstructionArguments(const string& name,
232 DVLOG(1) << "Histogram: " << name << " has bad minimum: " << *minimum;
236 DVLOG(1) << "Histogram: " << name << " has bad maximum: " << *maximum;
240 DVLOG(1) << "Histogram: " << name << " has bad bucket_count: "
254 HistogramType Histogram::GetHistogramType() const {
255 return HISTOGRAM;
258 bool Histogram::HasConstructionArguments(Sample expected_minimum,
266 void Histogram::Add(int value) {
277 scoped_ptr<HistogramSamples> Histogram::SnapshotSamples() const {
281 void Histogram::AddSamples(const HistogramSamples& samples) {
285 bool Histogram::AddSamplesFromPickle(PickleIterator* iter) {
289 // The following methods provide a graphical histogram display.
290 void Histogram::WriteHTMLGraph(string* output) const {
297 void Histogram::WriteAscii(string* output) const {
301 bool Histogram::SerializeInfoImpl(Pickle* pickle) const {
311 Histogram::Histogram(const string& name,
323 Histogram::~Histogram() {
326 bool Histogram::PrintEmptyBucket(size_t index) const {
330 // Use the actual bucket widths (like a linear histogram) until the widths get
335 double Histogram::GetBucketSize(Count current, size_t i) const {
344 const string Histogram::GetAsciiBucketRange(size_t i) const {
352 HistogramBase* Histogram::DeserializeInfoImpl(PickleIterator* iter) {
365 // Find or create the local version of the histogram in this process.
366 HistogramBase* histogram = Histogram::FactoryGet(
369 if (!ValidateRangeChecksum(*histogram, range_checksum)) {
370 // The serialized histogram might be corrupted.
373 return histogram;
376 scoped_ptr<SampleVector> Histogram::SnapshotSampleVector() const {
382 void Histogram::WriteAsciiImpl(bool graph_it,
399 // nearly the largest bucket range without sliding over the histogram.
419 // Output the actual histogram graph.
449 double Histogram::GetPeakBucketSize(const SampleVector& samples) const {
459 void Histogram::WriteAsciiHeader(const SampleVector& samples,
463 "Histogram: %s recorded %d samples",
477 void Histogram
490 void Histogram::GetParameters(DictionaryValue* params) const {
497 void Histogram::GetCountAndBucketData(Count* count,
519 // LinearHistogram: This histogram uses a traditional set of evenly spaced
550 bool valid_arguments = Histogram::InspectConstructionArguments(
554 HistogramBase* histogram = StatisticsRecorder::FindHistogram(name);
555 if (!histogram) {
574 histogram =
578 DCHECK_EQ(LINEAR_HISTOGRAM, histogram->GetHistogramType());
579 if (!histogram->HasConstructionArguments(minimum, maximum, bucket_count)) {
580 // The construction arguments do not match the existing histogram. This can
586 DLOG(ERROR) << "Histogram " << name << " has bad construction arguments";
589 return histogram;
600 : Histogram(name, minimum, maximum, ranges) {
606 // samples in a histogram if we didn't normalize this way.
615 return Histogram::GetAsciiBucketRange(i);
653 HistogramBase* histogram = LinearHistogram::FactoryGet(
655 if (!ValidateRangeChecksum(*histogram, range_checksum)) {
656 // The serialized histogram might be corrupted.
659 return histogram;
667 HistogramBase* histogram = StatisticsRecorder::FindHistogram(name);
668 if (!histogram) {
679 histogram =
683 DCHECK_EQ(BOOLEAN_HISTOGRAM, histogram->GetHistogramType());
684 return histogram;
708 HistogramBase* histogram = BooleanHistogram::FactoryGet(
710 if (!ValidateRangeChecksum(*histogram, range_checksum)) {
711 // The serialized histogram might be corrupted.
714 return histogram;
726 HistogramBase* histogram = StatisticsRecorder::FindHistogram(name);
727 if (!histogram) {
738 histogram =
742 DCHECK_EQ(histogram->GetHistogramType(), CUSTOM_HISTOGRAM);
743 return histogram;
767 : Histogram(name,
773 if (!Histogram::SerializeInfoImpl(pickle))
811 HistogramBase* histogram = CustomHistogram::FactoryGet(
813 if (!ValidateRangeChecksum(*histogram, range_checksum)) {
814 // The serialized histogram might be corrupted.
817 return histogram;