| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "platform/Histogram.h" |
| 6 |
| 7 #include "base/metrics/histogram.h" |
| 8 #include "base/metrics/sparse_histogram.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 CustomCountHistogram::CustomCountHistogram(const char* name, int32_t min, int32_
t max, int32_t bucketCount) |
| 13 { |
| 14 m_histogram = base::Histogram::FactoryGet(name, min, max, bucketCount, base:
:HistogramBase::kNoFlags); |
| 15 } |
| 16 |
| 17 CustomCountHistogram::CustomCountHistogram(base::HistogramBase* histogram) |
| 18 : m_histogram(histogram) |
| 19 { |
| 20 } |
| 21 |
| 22 void CustomCountHistogram::count(int32_t sample) |
| 23 { |
| 24 m_histogram->Add(sample); |
| 25 } |
| 26 |
| 27 EnumerationHistogram::EnumerationHistogram(const char* name, int32_t boundaryVal
ue) |
| 28 : CustomCountHistogram(base::LinearHistogram::FactoryGet(name, 1, boundaryVa
lue, boundaryValue + 1, base::HistogramBase::kNoFlags)) |
| 29 { |
| 30 } |
| 31 |
| 32 SparseHistogram::SparseHistogram(const char* name) |
| 33 { |
| 34 m_histogram = base::SparseHistogram::FactoryGet(name, base::HistogramBase::k
UmaTargetedHistogramFlag); |
| 35 } |
| 36 |
| 37 void SparseHistogram::sample(int32_t sample) |
| 38 { |
| 39 m_histogram->Add(sample); |
| 40 } |
| 41 |
| 42 } // namespace blink |
| OLD | NEW |