blob: b6e643c489e7b003ba081cea1fc7af5399792b15 (
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <vespa/vespalib/stllike/string.h>
#include "dimension.h"
#include "label.h"
#include "metric_id.h"
#include "point.h"
#include "name_collection.h"
#include "point_map_collection.h"
namespace vespalib {
namespace metrics {
/**
* Simple repo class
**/
class NameRepo
{
private:
NameCollection _metricNames;
NameCollection _dimensionNames;
NameCollection _labelValues;
PointMapCollection _pointMaps;
NameRepo() = default;
~NameRepo() = default;
public:
MetricId metric(const vespalib::string &name);
Dimension dimension(const vespalib::string &name);
Label label(const vespalib::string &value);
const vespalib::string& metricName(MetricId metric);
const vespalib::string& dimensionName(Dimension dim);
const vespalib::string& labelValue(Label l);
const PointMap::BackingMap& pointMap(Point from);
Point pointFrom(PointMap::BackingMap map);
static NameRepo instance;
};
} // namespace vespalib::metrics
} // namespace vespalib
|