aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/metrics/dimension.h
blob: 27ed652be51b0ec319e98c93b8932d2189d47c75 (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
// Copyright Vespa.ai. 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 "handle.h"

namespace vespalib::metrics {

using DimensionName = vespalib::string;

struct DimensionTag {};

/**
 * Opaque handle representing an uniquely named dimension.
 **/
struct Dimension : Handle<DimensionTag>
{
    explicit Dimension(size_t id) : Handle(id) {}
    static Dimension from_name(const vespalib::string& name);
    const vespalib::string& as_name() const;
};

} // namespace vespalib::metrics