diff options
author | Ola Aunrønning <olaa@oath.com> | 2019-05-14 14:07:05 +0200 |
---|---|---|
committer | Ola Aunrønning <olaa@oath.com> | 2019-05-15 17:25:46 +0200 |
commit | 9939c43de97bfa37b92003a20d92fd68c099533b (patch) | |
tree | 9f7d022829d9143b0fcc00114f87cbe819c53d89 /controller-api | |
parent | d254455be444517118ab45320e31fc9068793f42 (diff) |
Controller side metric handling
Diffstat (limited to 'controller-api')
4 files changed, 81 insertions, 0 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/metrics/ClusterMetrics.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/metrics/ClusterMetrics.java new file mode 100644 index 00000000000..dd301c73b8d --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/metrics/ClusterMetrics.java @@ -0,0 +1,39 @@ +// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.hosted.controller.api.application.v4.model.metrics; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author olaa + */ +public class ClusterMetrics { + + private final String clusterId; + private final ClusterType clusterType; + private final Map<String, Double> metrics; + + public ClusterMetrics(String clusterId, ClusterType clusterType) { + this.clusterId = clusterId; + this.clusterType = clusterType; + this.metrics = new HashMap<>(); + } + + public String getClusterId() { + return clusterId; + } + + public ClusterType getClusterType() { + return clusterType; + } + + public Map<String, Double> getMetrics() { + return metrics; + } + + public void addMetric(String name, double value) { + metrics.put(name, value); + } + + public enum ClusterType {content, container}; +} diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/metrics/ContainerClusterMetrics.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/metrics/ContainerClusterMetrics.java new file mode 100644 index 00000000000..9bb7213f8f9 --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/metrics/ContainerClusterMetrics.java @@ -0,0 +1,22 @@ +// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.hosted.controller.api.application.v4.model.metrics; + +/** + * @author olaa + */ +public class ContainerClusterMetrics { + + private final double queriesPerSecond; + private final double writesPerSecond; + private final double queryLatencyMillis; + private final double writeLatencyMills; + + public ContainerClusterMetrics(String clusterId, double queriesPerSecond, double writesPerSecond, double queryLatencyMillis, double writeLatencyMills) { + this.queriesPerSecond = queriesPerSecond; + this.writesPerSecond = writesPerSecond; + this.queryLatencyMillis = queryLatencyMillis; + this.writeLatencyMills = writeLatencyMills; + } + + +} diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/metrics/ContentClusterMetrics.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/metrics/ContentClusterMetrics.java new file mode 100644 index 00000000000..0ccc19e0172 --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/metrics/ContentClusterMetrics.java @@ -0,0 +1,16 @@ +// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.hosted.controller.api.application.v4.model.metrics; + +import com.yahoo.config.provision.ClusterSpec; + +/** + * @author olaa + */ +public class ContentClusterMetrics{ + + private final double documentCount; + + public ContentClusterMetrics(String clusterId, double documentCount) { + this.documentCount = documentCount; + } +} diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java index bcad82a23c1..6636b1ea73f 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java @@ -3,9 +3,11 @@ package com.yahoo.vespa.hosted.controller.api.integration.configserver; import com.yahoo.vespa.hosted.controller.api.application.v4.model.DeployOptions; import com.yahoo.vespa.hosted.controller.api.application.v4.model.EndpointStatus; +import com.yahoo.vespa.hosted.controller.api.application.v4.model.metrics.ClusterMetrics; import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId; import com.yahoo.vespa.hosted.controller.api.identifiers.Hostname; import com.yahoo.config.provision.zone.ZoneId; +import com.yahoo.config.provision.ApplicationId; import com.yahoo.vespa.serviceview.bindings.ApplicationView; import java.io.IOException; @@ -43,6 +45,8 @@ public interface ConfigServer { InputStream getLogs(DeploymentId deployment, Map<String, String> queryParameters); + Map<ApplicationId, List<ClusterMetrics>> getMetrics(ZoneId zoneId); + List<String> getContentClusters(DeploymentId deployment); /** |