diff options
author | Martin Polden <mpolden@mpolden.no> | 2021-06-25 14:25:50 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2021-06-25 14:25:50 +0200 |
commit | 08ffd94ff85a924de24ea61859fb0fa64a53c1f7 (patch) | |
tree | a09b7adcb46b42cf349cc20373be9581d1fbeec2 | |
parent | be9794ef1d16a5511334539a2cc6fe5216031ea7 (diff) |
Remove obsolete version check
2 files changed, 6 insertions, 12 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentMetricsMaintainer.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentMetricsMaintainer.java index ba4aaf92fc8..7f8cc8f7f0a 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentMetricsMaintainer.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentMetricsMaintainer.java @@ -57,7 +57,6 @@ public class DeploymentMetricsMaintainer extends ControllerMaintainer { for (Deployment deployment : instance.deployments().values()) { attempts.incrementAndGet(); try { - if (deployment.version().getMajor() < 7) continue; DeploymentId deploymentId = new DeploymentId(instance.id(), deployment.zone()); List<ClusterMetrics> clusterMetrics = controller().serviceRegistry().configServer().getDeploymentMetrics(deploymentId); Instant now = controller().clock().instant(); @@ -80,10 +79,13 @@ public class DeploymentMetricsMaintainer extends ControllerMaintainer { ); pool.shutdown(); try { - pool.awaitTermination(30, TimeUnit.MINUTES); + Duration timeout = Duration.ofMinutes(30); + if (!pool.awaitTermination(timeout.toMillis(), TimeUnit.MILLISECONDS)) { + log.log(Level.WARNING, "Could not shut down metrics collection thread pool within " + timeout); + } if (lastException.get() != null) { log.log(Level.WARNING, - String.format("Failed to gather metrics for %d/%d applications. Retrying in %s. Last error: %s", + String.format("Could not gather metrics for %d/%d deployments. Retrying in %s. Last error: %s", failures.get(), attempts.get(), interval(), @@ -117,4 +119,5 @@ public class DeploymentMetricsMaintainer extends ControllerMaintainer { return weightedLatency / rateSum; } + } diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentMetricsMaintainerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentMetricsMaintainerTest.java index c45aaa563e1..8083b847c0b 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentMetricsMaintainerTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentMetricsMaintainerTest.java @@ -50,15 +50,6 @@ public class DeploymentMetricsMaintainerTest { assertFalse("Never received any queries", deployment.get().activity().lastQueried().isPresent()); assertFalse("Never received any writes", deployment.get().activity().lastWritten().isPresent()); - // Only get application metrics for old version - application.runJob(JobType.devUsEast1, new ApplicationPackage(new byte[0]), Version.fromString("6.3.3")); - maintainer.maintain(); - assertEquals(0, app.get().metrics().queryServiceQuality(), 0); - assertEquals(0, deployment.get().metrics().documentCount(), 0); - assertFalse("No timestamp set", deployment.get().metrics().instant().isPresent()); - assertFalse("Never received any queries", deployment.get().activity().lastQueried().isPresent()); - assertFalse("Never received any writes", deployment.get().activity().lastWritten().isPresent()); - // Metrics are gathered and saved to application application.runJob(JobType.devUsEast1, new ApplicationPackage(new byte[0]), Version.fromString("7.5.5")); var metrics0 = Map.of(ClusterMetrics.QUERIES_PER_SECOND, 1D, |