diff options
author | Valerij Fredriksen <freva@users.noreply.github.com> | 2023-05-17 18:32:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-17 18:32:40 +0200 |
commit | 3a88b880f0b6323959dafeeb8e0076a7f515e311 (patch) | |
tree | 8ada603b5dd1c597e79020d7d0e998d3b5b1dd11 | |
parent | 20adef2ca76b6e781bb9dafa34bbf729bdcb0a03 (diff) | |
parent | 4b3c04825157cfca7d3805fbfa8e04d144c99daf (diff) |
Merge pull request #27150 from vespa-engine/bratseth/ignore-too-long-completions
Ignore too long completions instead of defaulting
-rw-r--r-- | node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Cluster.java | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Cluster.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Cluster.java index 6a81c17d362..65e0bc558b2 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Cluster.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/applications/Cluster.java @@ -197,9 +197,11 @@ public class Cluster { Duration totalDuration = Duration.ZERO; for (ScalingEvent event : scalingEvents()) { if (event.duration().isEmpty()) continue; + // Assume we have missed timely recording completion if it is longer than 4 days, so ignore + if ( ! event.duration().get().minus(Duration.ofDays(4)).isNegative()) continue; + completedEventCount++; - // Assume we have missed timely recording completion if it is longer than 4 days - totalDuration = totalDuration.plus(maximum(Duration.ofDays(4), event.duration().get())); + totalDuration = totalDuration.plus(event.duration().get()); } if (completedEventCount == 0) { // Use defaults if (clusterSpec.isStateful()) return Duration.ofHours(12); @@ -223,10 +225,4 @@ public class Cluster { return duration; } - private static Duration maximum(Duration largestAllowed, Duration duration) { - if ( ! duration.minus(largestAllowed).isNegative()) - return largestAllowed; - return duration; - } - } |