aboutsummaryrefslogtreecommitdiffstats
path: root/metrics/src/vespa/metrics/common/memory_usage_metrics.h
blob: 34b88ffe99b173e55f8b0ca75ec86cfcd05d17c3 (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 Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/metrics/valuemetric.h>
#include <vespa/metrics/metricset.h>

namespace vespalib { class MemoryUsage; }

namespace metrics {

/**
 * Metric set for memory usage metrics.
 */
class MemoryUsageMetrics : public metrics::MetricSet {
    metrics::LongValueMetric _allocated_bytes;
    metrics::LongValueMetric _used_bytes;
    metrics::LongValueMetric _dead_bytes;
    metrics::LongValueMetric _on_hold_bytes;

public:
    explicit MemoryUsageMetrics(metrics::MetricSet* parent);
    ~MemoryUsageMetrics() override;
    void update(const vespalib::MemoryUsage& usage);
};

} // namespace metrics