summaryrefslogtreecommitdiffstats
path: root/node-repository
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2021-03-08 10:47:39 +0100
committerJon Bratseth <bratseth@gmail.com>2021-03-08 10:47:39 +0100
commitfb4353126057d0ffce75b1b7f7482a82b36dbc19 (patch)
tree97d525e698e7514491d6e058aa2c90dbcce4d029 /node-repository
parent49229a98785dc6e25255522806480fc31b04e2e9 (diff)
Check for zero minutes
Diffstat (limited to 'node-repository')
-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 150958835ac..a5e21c29fb3 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.isZero()) {
+ if ( duration.toMinutes() != 0) {
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.isZero()) continue;
+ if (duration.toMinutes() == 0) continue;
double growthRate = (queryRateAt(end) - queryRateAt(start)) / duration.toMinutes();
if (growthRate > maxGrowthRate)
maxGrowthRate = growthRate;