aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/metrics/metric_id.h
blob: fe5194fc4941dd3adfd1fd6f98c856e533edf14b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "handle.h"
#include <vespa/vespalib/stllike/string.h>

namespace vespalib::metrics {

struct MetricIdTag {};

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

} // namespace vespalib::metrics