aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Cluster.java36
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/ClusterData.java15
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/ClusterUtilizationData.java8
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java7
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/response/application.json18
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java9
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-clusters.json13
7 files changed, 92 insertions, 14 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Cluster.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Cluster.java
index 2f77fa6cfc4..86f649d08ab 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Cluster.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Cluster.java
@@ -4,6 +4,7 @@ package com.yahoo.vespa.hosted.controller.api.integration.configserver;
import com.yahoo.config.provision.ClusterResources;
import com.yahoo.config.provision.ClusterSpec;
+import java.time.Duration;
import java.time.Instant;
import java.util.List;
import java.util.Optional;
@@ -14,6 +15,7 @@ import java.util.Optional;
public class Cluster {
private final ClusterSpec.Id id;
+ private final ClusterSpec.Type type;
private final ClusterResources min;
private final ClusterResources max;
private final ClusterResources current;
@@ -22,8 +24,13 @@ public class Cluster {
private final Utilization utilization;
private final List<ScalingEvent> scalingEvents;
private final String autoscalingStatus;
+ private final Duration scalingDuration;
+ private final double maxQueryGrowthRate;
+ private final double currentQueryFractionOfMax;
+
public Cluster(ClusterSpec.Id id,
+ ClusterSpec.Type type,
ClusterResources min,
ClusterResources max,
ClusterResources current,
@@ -31,8 +38,12 @@ public class Cluster {
Optional<ClusterResources> suggested,
Utilization utilization,
List<ScalingEvent> scalingEvents,
- String autoscalingStatus) {
+ String autoscalingStatus,
+ Duration scalingDuration,
+ double maxQueryGrowthRate,
+ double currentQueryFractionOfMax) {
this.id = id;
+ this.type = type;
this.min = min;
this.max = max;
this.current = current;
@@ -41,9 +52,13 @@ public class Cluster {
this.utilization = utilization;
this.scalingEvents = scalingEvents;
this.autoscalingStatus = autoscalingStatus;
+ this.scalingDuration = scalingDuration;
+ this.maxQueryGrowthRate = maxQueryGrowthRate;
+ this.currentQueryFractionOfMax = currentQueryFractionOfMax;
}
public ClusterSpec.Id id() { return id; }
+ public ClusterSpec.Type type() { return type; }
public ClusterResources min() { return min; }
public ClusterResources max() { return max; }
public ClusterResources current() { return current; }
@@ -52,6 +67,9 @@ public class Cluster {
public Utilization utilization() { return utilization; }
public List<ScalingEvent> scalingEvents() { return scalingEvents; }
public String autoscalingStatus() { return autoscalingStatus; }
+ public Duration scalingDuration() { return scalingDuration; }
+ public double maxQueryGrowthRate() { return maxQueryGrowthRate; }
+ public double currentQueryFractionOfMax() { return currentQueryFractionOfMax; }
@Override
public String toString() {
@@ -60,19 +78,29 @@ public class Cluster {
public static class Utilization {
- private final double cpu, memory, disk;
+ private final double cpu, idealCpu, memory, idealMemory, disk, idealDisk;
- public Utilization(double cpu, double memory, double disk) {
+ public Utilization(double cpu, double idealCpu,
+ double memory, double idealMemory,
+ double disk, double idealDisk) {
this.cpu = cpu;
+ this.idealCpu = idealCpu;
this.memory = memory;
+ this.idealMemory = idealMemory;
this.disk = disk;
+ this.idealDisk = idealDisk;
}
public double cpu() { return cpu; }
+ public double idealCpu() { return idealCpu; }
+
public double memory() { return memory; }
+ public double idealMemory() { return idealMemory; }
+
public double disk() { return disk; }
+ public double idealDisk() { return idealDisk; }
- public static Utilization empty() { return new Utilization(0, 0, 0); }
+ public static Utilization empty() { return new Utilization(0, 0, 0, 0, 0, 0); }
}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/ClusterData.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/ClusterData.java
index 688b2764c87..d62ab781a50 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/ClusterData.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/ClusterData.java
@@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.vespa.hosted.controller.api.integration.configserver.Cluster;
+import java.time.Duration;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
@@ -18,6 +19,8 @@ import java.util.stream.Collectors;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ClusterData {
+ @JsonProperty("type")
+ public String type;
@JsonProperty("min")
public ClusterResourcesData min;
@JsonProperty("max")
@@ -34,9 +37,16 @@ public class ClusterData {
public List<ScalingEventData> scalingEvents;
@JsonProperty("autoscalingStatus")
public String autoscalingStatus;
+ @JsonProperty("scalingDuration")
+ public Long scalingDuration;
+ @JsonProperty("maxQueryGrowthRate")
+ public Double maxQueryGrowthRate;
+ @JsonProperty("currentQueryFractionOfMax")
+ public Double currentQueryFractionOfMax;
public Cluster toCluster(String id) {
return new Cluster(ClusterSpec.Id.from(id),
+ ClusterSpec.Type.from(type),
min.toClusterResources(),
max.toClusterResources(),
current.toClusterResources(),
@@ -45,7 +55,10 @@ public class ClusterData {
utilization == null ? Cluster.Utilization.empty() : utilization.toClusterUtilization(),
scalingEvents == null ? List.of()
: scalingEvents.stream().map(data -> data.toScalingEvent()).collect(Collectors.toList()),
- autoscalingStatus);
+ autoscalingStatus,
+ Duration.ofMillis(scalingDuration),
+ maxQueryGrowthRate,
+ currentQueryFractionOfMax);
}
}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/ClusterUtilizationData.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/ClusterUtilizationData.java
index a7de7664572..0465a1037e8 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/ClusterUtilizationData.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/ClusterUtilizationData.java
@@ -19,15 +19,21 @@ public class ClusterUtilizationData {
@JsonProperty("cpu")
public Double cpu;
+ @JsonProperty("idealCpu")
+ public Double idealCpu;
@JsonProperty("memory")
public Double memory;
+ @JsonProperty("idealMemory")
+ public Double idealMemory;
@JsonProperty("disk")
public Double disk;
+ @JsonProperty("idealDisk")
+ public Double idealDisk;
public Cluster.Utilization toClusterUtilization() {
- return new Cluster.Utilization(cpu, memory, disk);
+ return new Cluster.Utilization(cpu, idealCpu, memory, idealMemory, disk, idealDisk);
}
}
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
index 6aeb30c3f09..19db1bb0eb6 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
@@ -811,6 +811,7 @@ public class ApplicationApiHandler extends LoggingRequestHandler {
Cursor clustersObject = slime.setObject().setObject("clusters");
for (Cluster cluster : application.clusters().values()) {
Cursor clusterObject = clustersObject.setObject(cluster.id().value());
+ clusterObject.setString("type", cluster.type().name());
toSlime(cluster.min(), clusterObject.setObject("min"));
toSlime(cluster.max(), clusterObject.setObject("max"));
toSlime(cluster.current(), clusterObject.setObject("current"));
@@ -821,6 +822,9 @@ public class ApplicationApiHandler extends LoggingRequestHandler {
utilizationToSlime(cluster.utilization(), clusterObject.setObject("utilization"));
scalingEventsToSlime(cluster.scalingEvents(), clusterObject.setArray("scalingEvents"));
clusterObject.setString("autoscalingStatus", cluster.autoscalingStatus());
+ clusterObject.setLong("scalingDuration", cluster.scalingDuration().toMillis());
+ clusterObject.setDouble("maxQueryGrowthRate", cluster.maxQueryGrowthRate());
+ clusterObject.setDouble("currentQueryFractionOfMax", cluster.currentQueryFractionOfMax());
}
return new SlimeJsonResponse(slime);
}
@@ -2069,8 +2073,11 @@ public class ApplicationApiHandler extends LoggingRequestHandler {
private void utilizationToSlime(Cluster.Utilization utilization, Cursor utilizationObject) {
utilizationObject.setDouble("cpu", utilization.cpu());
+ utilizationObject.setDouble("idealCpu", utilization.idealCpu());
utilizationObject.setDouble("memory", utilization.memory());
+ utilizationObject.setDouble("idealMemory", utilization.idealMemory());
utilizationObject.setDouble("disk", utilization.disk());
+ utilizationObject.setDouble("idealDisk", utilization.idealDisk());
}
private void scalingEventsToSlime(List<Cluster.ScalingEvent> scalingEvents, Cursor scalingEventsArray) {
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/response/application.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/response/application.json
index ccfb6af1635..928fabd621e 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/response/application.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/response/application.json
@@ -3,6 +3,7 @@
"id": "vespa.album-recommendation.default",
"clusters": {
"default": {
+ "type": "container",
"min": {
"nodes": 2,
"groups": 1,
@@ -50,9 +51,13 @@
"diskSpeed": "fast",
"storageType": "local"
}
- }
+ },
+ "scalingDuration": 400000,
+ "maxQueryGrowthRate": 0.7,
+ "currentQueryFractionOfMax": 0.3
},
"logserver": {
+ "type": "admin",
"min": {
"nodes": 1,
"groups": 1,
@@ -100,9 +105,13 @@
"diskSpeed": "fast",
"storageType": "local"
}
- }
+ },
+ "scalingDuration": 90000,
+ "maxQueryGrowthRate": 0.7,
+ "currentQueryFractionOfMax": 0.3
},
"music": {
+ "type": "content",
"min": {
"nodes": 2,
"groups": 1,
@@ -150,7 +159,10 @@
"diskSpeed": "fast",
"storageType": "local"
}
- }
+ },
+ "scalingDuration": 1000000,
+ "maxQueryGrowthRate": 0.7,
+ "currentQueryFractionOfMax": 0.3
}
}
} \ No newline at end of file
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
index b219ee7ee9f..a7a99f286df 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
@@ -50,6 +50,7 @@ import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.net.URI;
import java.nio.charset.StandardCharsets;
+import java.time.Duration;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Collection;
@@ -112,16 +113,20 @@ public class ConfigServerMock extends AbstractComponent implements ConfigServer
public void provision(ZoneId zone, ApplicationId application, ClusterSpec.Id clusterId) {
var current = new ClusterResources(2, 1, new NodeResources(2, 8, 50, 1, slow, remote));
Cluster cluster = new Cluster(clusterId,
+ ClusterSpec.Type.container,
new ClusterResources(2, 1, new NodeResources(1, 4, 20, 1, slow, remote)),
new ClusterResources(2, 1, new NodeResources(4, 16, 90, 1, slow, remote)),
current,
Optional.of(new ClusterResources(2, 1, new NodeResources(3, 8, 50, 1, slow, remote))),
Optional.empty(),
- new Cluster.Utilization(0.1, 0.2, 0.3),
+ new Cluster.Utilization(0.1, 0.2, 0.3, 0.4, 0.5, 0.6),
List.of(new Cluster.ScalingEvent(new ClusterResources(0, 0, NodeResources.unspecified()),
current,
Instant.ofEpochMilli(1234))),
- "the autoscaling status");
+ "the autoscaling status",
+ Duration.ofMinutes(6),
+ 0.7,
+ 0.3);
nodeRepository.putApplication(zone,
new com.yahoo.vespa.hosted.controller.api.integration.configserver.Application(application,
List.of(cluster)));
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-clusters.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-clusters.json
index 2c208359f1b..499a425087d 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-clusters.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application-clusters.json
@@ -1,6 +1,7 @@
{
"clusters": {
"default": {
+ "type":"container",
"min": {
"nodes": 2,
"groups": 1,
@@ -55,8 +56,11 @@
},
"utilization": {
"cpu": 0.1,
- "memory": 0.2,
- "disk": 0.3
+ "idealCpu": 0.2,
+ "memory": 0.3,
+ "idealMemory": 0.4,
+ "disk": 0.5,
+ "idealDisk": 0.6
},
"scalingEvents": [
{
@@ -89,7 +93,10 @@
"at": 1234
}
],
- "autoscalingStatus": "the autoscaling status"
+ "autoscalingStatus": "the autoscaling status",
+ "scalingDuration": 360000,
+ "maxQueryGrowthRate": 0.7,
+ "currentQueryFractionOfMax":0.3
}
}
} \ No newline at end of file