aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2021-03-08 19:51:31 +0100
committerGitHub <noreply@github.com>2021-03-08 19:51:31 +0100
commitc13235491f9fd050ee33701a887ca7da5edd2945 (patch)
tree8ae85fad725407b1f3e021889deaef81bed1a957
parent6caf3fd12fc5fdb4dde20756e3f2c9d8c55e57b5 (diff)
parent51eadd43c47c043cb1d06ea3f437020bf4feec3a (diff)
Merge pull request #16844 from vespa-engine/revert-16832-bratseth/check-for-zero-minutes
Revert "Check for zero minutes"
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterTimeseries.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterTimeseries.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterTimeseries.java
index a5e21c29fb3..150958835ac 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterTimeseries.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterTimeseries.java
@@ -55,7 +55,7 @@ public class ClusterTimeseries {
for (int start = 0; start < snapshots.size(); start++) {
if (start > 0) { // Optimization: Skip this point when starting from the previous is better relative to the best rate so far
Duration duration = durationBetween(start - 1, start);
- if ( duration.toMinutes() != 0) {
+ if ( ! duration.isZero()) {
double growthRate = (queryRateAt(start - 1) - queryRateAt(start)) / duration.toMinutes();
if (growthRate >= maxGrowthRate)
continue;
@@ -64,7 +64,7 @@ public class ClusterTimeseries {
for (int end = start + 1; end < snapshots.size(); end++) {
if (queryRateAt(end) >= queryRateAt(start) * 1.3) {
Duration duration = durationBetween(start, end);
- if (duration.toMinutes() == 0) continue;
+ if (duration.isZero()) continue;
double growthRate = (queryRateAt(end) - queryRateAt(start)) / duration.toMinutes();
if (growthRate > maxGrowthRate)
maxGrowthRate = growthRate;