diff options
Diffstat (limited to 'configd/src/apps/sentinel/metrics.cpp')
-rw-r--r-- | configd/src/apps/sentinel/metrics.cpp | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/configd/src/apps/sentinel/metrics.cpp b/configd/src/apps/sentinel/metrics.cpp index df1b0076001..812ab56cd15 100644 --- a/configd/src/apps/sentinel/metrics.cpp +++ b/configd/src/apps/sentinel/metrics.cpp @@ -1,13 +1,9 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "metrics.h" -#include <vespa/log/log.h> -LOG_SETUP(".metrics"); - #include <vespa/vespalib/metrics/simple_metrics.h> -namespace config { -namespace sentinel { +namespace config::sentinel { using vespalib::metrics::SimpleMetricsManager; using vespalib::metrics::SimpleManagerConfig; @@ -17,9 +13,7 @@ StartMetrics::StartMetrics() producer(metrics), currentlyRunningServices(0), totalRestartsCounter(0), - totalRestartsLastPeriod(1), startedTime(time(nullptr)), - lastLoggedTime(startedTime - 55), sentinel_restarts(metrics->counter("sentinel.restarts", "how many times sentinel restarted a service")), sentinel_totalRestarts(metrics->gauge("sentinel.totalRestarts", @@ -33,20 +27,7 @@ StartMetrics::StartMetrics() sentinel_restarts.add(); } -void -StartMetrics::output() -{ - EV_VALUE("currently_running_services", currentlyRunningServices); - EV_VALUE("total_restarts_last_period", totalRestartsLastPeriod); - EV_COUNT("total_restarts_counter", totalRestartsCounter); -} - -void -StartMetrics::reset(unsigned long curTime) -{ - totalRestartsLastPeriod = 0; - lastLoggedTime = curTime; -} +StartMetrics::~StartMetrics() = default; void StartMetrics::maybeLog() @@ -55,11 +36,6 @@ StartMetrics::maybeLog() sentinel_totalRestarts.sample(totalRestartsCounter); sentinel_running.sample(currentlyRunningServices); sentinel_uptime.sample(curTime - startedTime); - if (curTime > lastLoggedTime + 59) { - output(); - reset(curTime); - } } -} // end namespace config::sentinel -} // end namespace config +} |