aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/metrics/producer.h
blob: b0b3e2bc7019b856c7273d427d56f69f647405a3 (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/net/http/metrics_producer.h>
#include <memory>

namespace vespalib::metrics {

class MetricsManager;

/**
 * Utility class for wiring a MetricsManager into a StateApi.
 **/
class Producer : public vespalib::MetricsProducer {
private:
    std::shared_ptr<MetricsManager> _manager;
public:
    Producer(std::shared_ptr<MetricsManager> m);
    vespalib::string getMetrics(const vespalib::string &consumer) override;
    vespalib::string getTotalMetrics(const vespalib::string &consumer) override;
};

}