diff options
Diffstat (limited to 'metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/HealthMetric.java')
-rw-r--r-- | metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/HealthMetric.java | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/HealthMetric.java b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/HealthMetric.java deleted file mode 100644 index 41a8c3d414e..00000000000 --- a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/HealthMetric.java +++ /dev/null @@ -1,56 +0,0 @@ -/* -* Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - */ - -package ai.vespa.metricsproxy.metric; - -/** - * @author Jo Kristian Bergum - */ -public class HealthMetric { - private final String message; - private final String status; - private final boolean isAlive; - - private HealthMetric(String status, String message, boolean isAlive) { - this.message = message; - this.status = status; - this.isAlive = isAlive; - } - - public static HealthMetric get(String status, String message) { - if (status == null) { - status = ""; - } - if (message == null) { - message = ""; - } - status = status.toLowerCase(); - - if (status.equals("up") || status.equals("ok")) { - return new HealthMetric(status, message, true); - } else { - return new HealthMetric(status, message, false); - } - } - - public static HealthMetric getFailed(String message) { - return new HealthMetric("down", message, false); - } - - public static HealthMetric getOk(String message) { - return new HealthMetric("up", message, true); - } - - public String getMessage() { - return this.message; - } - - public String getStatus() { - return this.status; - } - - public boolean isOk() { - return this.isAlive; - } -} |