aboutsummaryrefslogtreecommitdiffstats
path: root/configd/src/apps/sentinel/metrics.h
blob: a2099ca1add84995f7e0e1db7b0442420b2df65c (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 Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <vespa/vespalib/metrics/simple_metrics.h>
#include <vespa/vespalib/util/time.h>

namespace config::sentinel {

using vespalib::metrics::Counter;
using vespalib::metrics::Gauge;
using vespalib::metrics::MetricsManager;

struct StartMetrics {
    std::shared_ptr<MetricsManager> metrics;
    vespalib::metrics::Producer producer;
    unsigned long currentlyRunningServices;
    unsigned long totalRestartsCounter;
    vespalib::steady_time startedTime;
    Counter sentinel_restarts;
    Gauge   sentinel_totalRestarts;
    Gauge   sentinel_running;
    Gauge   sentinel_uptime;
    vespalib::steady_time lastRestartTime;

    StartMetrics();
    ~StartMetrics();

    void maybeLog();
    void incRestartsCounter();
};

}