diff options
-rw-r--r-- | node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/AutoscalingMaintainer.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/AutoscalingMaintainer.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/AutoscalingMaintainer.java index 84d677abde6..eab9f755db2 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/AutoscalingMaintainer.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/AutoscalingMaintainer.java @@ -82,10 +82,12 @@ public class AutoscalingMaintainer extends NodeRepositoryMaintainer { applications().put(application.get().with(updatedCluster), lock); if (advice.isPresent() && advice.target().isPresent() && !cluster.get().targetResources().equals(advice.target())) { // 2. Also autoscale - logAutoscaling(advice.target().get(), applicationId, clusterNodes); + ClusterResources before = new AllocatableClusterResources(clusterNodes.asList(), nodeRepository()).advertisedResources(); try (MaintenanceDeployment deployment = new MaintenanceDeployment(applicationId, deployer, metric, nodeRepository())) { - if (deployment.isValid()) + if (deployment.isValid()) { deployment.activate(); + logAutoscaling(before, advice.target().get(), applicationId, clusterNodes); + } } } } @@ -121,10 +123,9 @@ public class AutoscalingMaintainer extends NodeRepositoryMaintainer { return cluster.with(event.withCompletion(completionTime)); } - private void logAutoscaling(ClusterResources target, ApplicationId application, NodeList clusterNodes) { - ClusterResources current = new AllocatableClusterResources(clusterNodes.asList(), nodeRepository()).advertisedResources(); - log.info("Autoscaling " + application + " " + clusterNodes.clusterSpec() + ":" + - "\nfrom " + toString(current) + "\nto " + toString(target)); + private void logAutoscaling(ClusterResources from, ClusterResources to, ApplicationId application, NodeList clusterNodes) { + log.info("Autoscaled " + application + " " + clusterNodes.clusterSpec() + ":" + + "\nfrom " + toString(from) + "\nto " + toString(to)); } static String toString(ClusterResources r) { |