summaryrefslogtreecommitdiffstats
path: root/staging_vespalib/src/vespa/vespalib/metrics/metric_id.h
blob: 5f337e6decd3c8d72e63b62695725b3a747aa33f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright 2017 Yahoo Holdings. 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