diff options
author | Øyvind Grønnesby <oyving@verizonmedia.com> | 2020-01-08 15:38:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-08 15:38:57 +0100 |
commit | 93057cb2141dee8846c9304eb6a9aae2ba9c4dc0 (patch) | |
tree | 42a27eb6f64d5380d93200db00efcecaa0deb203 | |
parent | bee852eaebcc9ac33d605785d588a8de259b6243 (diff) | |
parent | 7748dad9b0e15bc868bc0f30eeb12eba150b116c (diff) |
Merge pull request #11702 from vespa-engine/olaa/allow-any-clustertype
Allow any cluster type
3 files changed, 6 insertions, 11 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/ClusterMetrics.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/ClusterMetrics.java index 9296e144bf7..f16e2e403ed 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/ClusterMetrics.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/ClusterMetrics.java @@ -18,10 +18,10 @@ public class ClusterMetrics { public static final String QUERY_LATENCY = "queryLatency"; private final String clusterId; - private final ClusterType clusterType; + private final String clusterType; private final Map<String, Double> metrics; - public ClusterMetrics(String clusterId, ClusterType clusterType) { + public ClusterMetrics(String clusterId, String clusterType) { this.clusterId = clusterId; this.clusterType = clusterType; this.metrics = new HashMap<>(); @@ -31,7 +31,7 @@ public class ClusterMetrics { return clusterId; } - public ClusterType getClusterType() { + public String getClusterType() { return clusterType; } @@ -60,9 +60,4 @@ public class ClusterMetrics { return this; } - public enum ClusterType { - content, - container - } - } diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentMetricsMaintainerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentMetricsMaintainerTest.java index 06a815819f4..ed8918786c5 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentMetricsMaintainerTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentMetricsMaintainerTest.java @@ -116,7 +116,7 @@ public class DeploymentMetricsMaintainerTest { } private void setMetrics(ApplicationId application, Map<String, Double> metrics) { - var clusterMetrics = new ClusterMetrics("default", ClusterMetrics.ClusterType.container); + var clusterMetrics = new ClusterMetrics("default", "container"); for (var kv : metrics.entrySet()) { clusterMetrics = clusterMetrics.addMetric(kv.getKey(), kv.getValue()); } diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/metric/ConfigServerMetricsTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/metric/ConfigServerMetricsTest.java index dad7ea4ec31..3d1cb3eba86 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/metric/ConfigServerMetricsTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/metric/ConfigServerMetricsTest.java @@ -44,12 +44,12 @@ public class ConfigServerMetricsTest { // var deploymentId = new DeploymentId(applicationId, zoneId); - var clusterMetrics1 = new ClusterMetrics("niceCluster", ClusterMetrics.ClusterType.container) {{ + var clusterMetrics1 = new ClusterMetrics("niceCluster", "container") {{ addMetric("queriesPerSecond", 23.0); addMetric("queryLatency", 1337.0); }}; - var clusterMetrics2 = new ClusterMetrics("alsoNiceCluster", ClusterMetrics.ClusterType.container) {{ + var clusterMetrics2 = new ClusterMetrics("alsoNiceCluster", "container") {{ addMetric("queriesPerSecond", 11.0); addMetric("queryLatency", 12.0); }}; |