summaryrefslogtreecommitdiffstats
path: root/staging_vespalib/src/vespa/vespalib/metrics/producer.cpp
blob: a848628a4c0053022e2a8635a52d4ca34d0ebd88 (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
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "producer.h"
#include "metrics_manager.h"
#include "json_formatter.h"

namespace vespalib {
namespace metrics {

Producer::Producer(std::shared_ptr<MetricsManager> m)
    : _manager(m)
{}

vespalib::string
Producer::getMetrics(const vespalib::string &)
{
    Snapshot snap = _manager->snapshot();
    JsonFormatter fmt(snap);
    return fmt.asString();
}

vespalib::string
Producer::getTotalMetrics(const vespalib::string &)
{
    // not implemented
    return "";
}



} // namespace vespalib::metrics
} // namespace vespalib