diff options
author | Jon Bratseth <bratseth@gmail.com> | 2021-03-08 19:57:22 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2021-03-08 19:57:22 +0100 |
commit | a34cb87e3ed569898a241c09f561def61e8eb7e9 (patch) | |
tree | 13201143c5e0a1ca749addae6cf8aac06100cd74 | |
parent | 983403480b5282e4b6adeb77779473d298686e08 (diff) |
Check for zero minutes
-rw-r--r-- | node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterTimeseries.java | 4 |
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..bc0fe528464 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; |