summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/Source/platform/Histogram.h
blob: a782a28bfbeb63f34610c33a781afcfa91ca976e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef Histogram_h
#define Histogram_h

#include "platform/PlatformExport.h"
#include <stdint.h>

namespace base {
class HistogramBase;
};

namespace blink {

class PLATFORM_EXPORT CustomCountHistogram {
public:
    CustomCountHistogram(const char* name, int32_t min, int32_t max, int32_t bucketCount);
    void count(int32_t sample);

protected:
    explicit CustomCountHistogram(base::HistogramBase*);

private:
    base::HistogramBase* m_histogram;
};

class PLATFORM_EXPORT EnumerationHistogram : public CustomCountHistogram {
public:
    EnumerationHistogram(const char* name, int32_t boundaryValue);
};

class PLATFORM_EXPORT SparseHistogram {
public:
    explicit SparseHistogram(const char* name);

    void sample(int32_t sample);

private:
    base::HistogramBase* m_histogram;
};

} // namespace blink

#endif // Histogram_h