aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/metrics/label.h
blob: b36db7c6916ff9f4a6e1374bd755bb13c7296aa3 (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 LabelValue = vespalib::string;

struct LabelTag {};

/**
 * Opaque handle representing an unique label value.
 **/
struct Label : Handle<LabelTag>
{
    explicit Label(size_t id) : Handle(id) {}
    static Label from_value(const vespalib::string& value);
    const vespalib::string& as_value() const;
};

} // namespace vespalib::metrics