blob: 3745269c8cde85b7fdd7bff708db5d5e22a9cb82 (
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.
#pragma once
#include "memory_usage_metrics.h"
#include <map>
namespace proton {
class AttributeMetrics
{
public:
struct Entry : public metrics::MetricSet {
using SP = std::shared_ptr<Entry>;
MemoryUsageMetrics memoryUsage;
Entry(const vespalib::string &attrName);
};
private:
using Map = std::map<vespalib::string, Entry::SP>;
metrics::MetricSet *_parent;
Map _attributes;
public:
AttributeMetrics(metrics::MetricSet *parent);
Entry::SP add(const vespalib::string &attrName);
Entry::SP get(const vespalib::string &attrName) const;
Entry::SP remove(const vespalib::string &attrName);
std::vector<Entry::SP> release();
metrics::MetricSet *parent() { return _parent; }
};
} // namespace proton
|