diff options
author | Valerij Fredriksen <freva@users.noreply.github.com> | 2021-03-08 10:49:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-08 10:49:34 +0100 |
commit | dca4f2fd027c987b96ce307910d70bb7bdbecee2 (patch) | |
tree | 97d525e698e7514491d6e058aa2c90dbcce4d029 | |
parent | 49229a98785dc6e25255522806480fc31b04e2e9 (diff) | |
parent | fb4353126057d0ffce75b1b7f7482a82b36dbc19 (diff) |
Merge pull request #16832 from vespa-engine/bratseth/check-for-zero-minutes
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..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; |