blob: e8118b6bd63bbee650ea7ed29cf0d9622ca4f071 (
plain) (
blame)
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
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <mutex>
#include <vector>
#include <vespa/vespalib/stllike/string.h>
namespace vespalib {
namespace metrics {
// internal class for typechecking
class MetricTypes {
static const char *_typeNames[];
public:
enum MetricType {
INVALID,
COUNTER,
GAUGE,
HISTOGRAM,
INT_HISTOGRAM
};
void check(size_t id, const vespalib::string& name, MetricType ty);
MetricTypes() = default;
~MetricTypes() {}
private:
std::mutex _lock;
std::vector<MetricType> _seen;
};
} // namespace vespalib::metrics
} // namespace vespalib
|