diff options
author | Jon Bratseth <bratseth@gmail.com> | 2023-01-11 13:50:38 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2023-01-11 13:50:38 +0100 |
commit | 15b1e27d6ac83ba19801c28c7c4a3cf235b7bbcd (patch) | |
tree | 589d84c673016d236fe902c6ef438ba0dcc43abc /controller-server | |
parent | 262f6794a55ef7837a2e5e380e24419cbb47060c (diff) |
Remove unused elements
Diffstat (limited to 'controller-server')
2 files changed, 3 insertions, 43 deletions
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 121c234725f..1505d7e2ca8 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 @@ -1359,12 +1359,9 @@ public class ApplicationApiHandler extends AuditLoggingRequestHandler { toSlime(cluster.min(), clusterObject.setObject("min")); toSlime(cluster.max(), clusterObject.setObject("max")); toSlime(cluster.current(), clusterObject.setObject("current")); - toSlime(cluster.target(), cluster, clusterObject.setObject("target")); - toSlime(cluster.suggested(), cluster, clusterObject.setObject("suggested")); - legacyUtilizationToSlime(cluster.target().peak(), cluster.target().ideal(), clusterObject.setObject("utilization")); // TODO: Remove after January 2023 + toSlime(cluster.target(), clusterObject.setObject("target")); + toSlime(cluster.suggested(), clusterObject.setObject("suggested")); scalingEventsToSlime(cluster.scalingEvents(), clusterObject.setArray("scalingEvents")); - clusterObject.setString("autoscalingStatusCode", cluster.target().status()); // TODO: Remove after January 2023 - clusterObject.setString("autoscalingStatus", cluster.target().description()); // TODO: Remove after January 2023 clusterObject.setLong("scalingDuration", cluster.scalingDuration().toMillis()); } return new SlimeJsonResponse(slime); @@ -2711,12 +2708,7 @@ public class ApplicationApiHandler extends AuditLoggingRequestHandler { object.setDouble("cost", cost); } - private void toSlime(Cluster.Autoscaling autoscaling, Cluster cluster, Cursor autoscalingObject) { - // TODO: Remove after January 2023 - if (autoscaling.resources().isPresent() - && ! autoscaling.resources().get().justNumbers().equals(cluster.current().justNumbers())) - toSlime(autoscaling.resources().get(), autoscalingObject); - + private void toSlime(Cluster.Autoscaling autoscaling, Cursor autoscalingObject) { autoscalingObject.setString("status", autoscaling.status()); autoscalingObject.setString("description", autoscaling.description()); autoscaling.resources().ifPresent(resources -> toSlime(resources, autoscalingObject.setObject("resources"))); @@ -2731,17 +2723,6 @@ public class ApplicationApiHandler extends AuditLoggingRequestHandler { loadObject.setDouble("disk", load.disk()); } - private void legacyUtilizationToSlime(Load peak, Load ideal, Cursor utilizationObject) { - utilizationObject.setDouble("idealCpu", ideal.cpu()); - utilizationObject.setDouble("peakCpu", peak.cpu()); - - utilizationObject.setDouble("idealMemory", ideal.memory()); - utilizationObject.setDouble("peakMemory", peak.memory()); - - utilizationObject.setDouble("idealDisk", ideal.disk()); - utilizationObject.setDouble("peakDisk", peak.disk()); - } - private void scalingEventsToSlime(List<Cluster.ScalingEvent> scalingEvents, Cursor scalingEventsArray) { for (Cluster.ScalingEvent scalingEvent : scalingEvents) { Cursor scalingEventObject = scalingEventsArray.addObject(); 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 c013ccb00fe..d9021b1d894 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 @@ -42,17 +42,6 @@ "cost": 0.22 }, "target": { - "nodes": 2, - "groups": 1, - "nodeResources": { - "vcpu": 3.0, - "memoryGb": 8.0, - "diskGb": 50.0, - "bandwidthGbps": 1.0, - "diskSpeed": "slow", - "storageType": "remote" - }, - "cost": 0.29, "status": "ideal", "description": "Cluster is ideally scaled", "resources": { @@ -95,14 +84,6 @@ "disk": 0.0 } }, - "utilization": { - "idealCpu": 0.2, - "peakCpu": 0.35, - "idealMemory": 0.5, - "peakMemory": 0.65, - "idealDisk": 0.8, - "peakDisk": 1.0 - }, "scalingEvents": [ { "from": { @@ -135,8 +116,6 @@ "completion": 2234 } ], - "autoscalingStatusCode": "ideal", - "autoscalingStatus": "Cluster is ideally scaled", "scalingDuration": 360000 } } |