Lines Matching defs:histogram
23 // Each test will have a clean state (no Histogram / BucketRanges
39 Histogram* CreateHistogram(const std::string& name,
44 Histogram::InitializeBucketRanges(min, max, ranges);
47 return new Histogram(name, min, max, registered_ranges);
50 void DeleteHistogram(HistogramBase* histogram) {
51 delete histogram;
68 Histogram* histogram = CreateHistogram("TestHistogram", 1, 1000, 10);
71 EXPECT_EQ(histogram,
72 StatisticsRecorder::RegisterOrDeleteDuplicate(histogram));
73 // Manually delete histogram that was not registered.
74 DeleteHistogram(histogram);
124 // Create a Histogram that was not registered.
125 Histogram* histogram = CreateHistogram("TestHistogram", 1, 1000, 10);
131 // Register the Histogram.
132 EXPECT_EQ(histogram,
133 StatisticsRecorder::RegisterOrDeleteDuplicate(histogram));
137 // Register the same Histogram again.
138 EXPECT_EQ(histogram,
139 StatisticsRecorder::RegisterOrDeleteDuplicate(histogram));
146 HistogramBase* histogram1 = Histogram::FactoryGet(
148 HistogramBase* histogram2 = Histogram::FactoryGet(
157 Histogram::FactoryGet("TestHistogram1", 1, 1000, 10, Histogram::kNoFlags);
158 Histogram::FactoryGet("TestHistogram2", 1, 1000, 10, Histogram::kNoFlags);
159 Histogram::FactoryGet("TestHistogram3", 1, 1000, 10, Histogram::kNoFlags);
180 // Create a histogram.
181 HistogramBase* histogram = Histogram::FactoryGet(
187 // Get an existing histogram.
188 HistogramBase* histogram2 = Histogram::FactoryGet(
193 EXPECT_EQ(histogram, histogram2);
196 histogram = LinearHistogram::FactoryGet(
203 histogram = BooleanHistogram::FactoryGet(
213 histogram = CustomHistogram::FactoryGet(
223 HistogramBase* histogram = Histogram::FactoryGet(
226 // The histogram we got from macro is the same as from FactoryGet.
231 EXPECT_EQ(histogram, registered_histograms[0]);
246 Histogram::FactoryGet("Histogram", 1, 64, 8, HistogramBase::kNoFlags);
247 Histogram::FactoryGet("Histogram2", 1, 64, 8, HistogramBase::kNoFlags);
252 Histogram::FactoryGet("Histogram3", 1, 64, 16, HistogramBase::kNoFlags);
281 // Examine the first histogram.
353 HistogramBase* histogram = Histogram::FactoryGet("TestHistogram", 1, 1000, 10,
355 EXPECT_TRUE(histogram);
363 EXPECT_EQ(histogram->flags() & base::HistogramBase::kCallbackExists,
370 EXPECT_EQ(histogram->flags() & base::HistogramBase::kCallbackExists,
373 histogram->Add(1);
380 HistogramBase* histogram = Histogram::FactoryGet("TestHistogram", 1, 1000, 10,
382 EXPECT_TRUE(histogram);
390 EXPECT_EQ(histogram->flags() & base::HistogramBase::kCallbackExists,
394 EXPECT_EQ(histogram->flags() & base::HistogramBase::kCallbackExists, 0);
396 histogram->Add(1);
404 HistogramBase* histogram = Histogram::FactoryGet(
406 EXPECT_TRUE(histogram);
414 histogram->Add(1);
475 // Check that setting a callback before the histogram exists works.
483 HistogramBase* histogram = Histogram::FactoryGet("TestHistogram", 1, 1000, 10,
485 EXPECT_TRUE(histogram);
486 histogram->Add(1);