blob: de3ed5d368f5e975dc606c8a7cdd09ccc2f3e7de (
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
|
// Copyright Yahoo. 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 &)
{
Snapshot snap = _manager->totalSnapshot();
JsonFormatter fmt(snap);
return fmt.asString();
}
} // namespace vespalib::metrics
} // namespace vespalib
|