aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/net/http/simple_metrics_producer.cpp
blob: 5fbddd8d1b2e0f106a94ecbb9b26cc2d5fede90b (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "simple_metrics_producer.h"

namespace vespalib {

SimpleMetricsProducer::SimpleMetricsProducer()
    : _lock(),
      _metrics(),
      _totalMetrics()
{
}

SimpleMetricsProducer::~SimpleMetricsProducer() = default;

void
SimpleMetricsProducer::setMetrics(const vespalib::string &metrics)
{
    std::lock_guard guard(_lock);
    _metrics = metrics;
}

vespalib::string
SimpleMetricsProducer::getMetrics(const vespalib::string &)
{
    std::lock_guard guard(_lock);
    return _metrics;
}

void
SimpleMetricsProducer::setTotalMetrics(const vespalib::string &metrics)
{
    std::lock_guard guard(_lock);
    _totalMetrics = metrics;
}

vespalib::string
SimpleMetricsProducer::getTotalMetrics(const vespalib::string &)
{
    std::lock_guard guard(_lock);
    return _totalMetrics;
}

} // namespace vespalib