aboutsummaryrefslogtreecommitdiffstats
path: root/node-repository
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2021-11-30 11:24:52 +0100
committerGitHub <noreply@github.com>2021-11-30 11:24:52 +0100
commit20e77bb7617213b82da289bbc126fb0b996316f3 (patch)
tree2cd1b62af16ebf44dec72dff6504ea3cd386e6be /node-repository
parentb6bdce380df2e0d178b071b180238fa9fe30a10a (diff)
parent303a72a4f8690fb41465b31b4e645a9e680f2f2c (diff)
Merge pull request #20285 from vespa-engine/bratseth/log-after-autoscaling
Log autoscaling after deploy
Diffstat (limited to 'node-repository')
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/AutoscalingMaintainer.java13
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) {