aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/net/http/simple_metrics_producer.h
blob: ad463c63d57fa09545ebe8cc888c58b5a3f6371c (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
24
25
26
27
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include "metrics_producer.h"
#include <mutex>

namespace vespalib {

class SimpleMetricsProducer : public MetricsProducer
{
private:
    std::mutex _lock;
    vespalib::string _metrics;
    vespalib::string _totalMetrics;

public:
    SimpleMetricsProducer();
    ~SimpleMetricsProducer() override;
    void setMetrics(const vespalib::string &metrics);
    vespalib::string getMetrics(const vespalib::string &consumer) override;
    void setTotalMetrics(const vespalib::string &metrics);
    vespalib::string getTotalMetrics(const vespalib::string &consumer) override;
};

} // namespace vespalib