diff options
author | Valerij Fredriksen <freva@users.noreply.github.com> | 2022-11-06 17:35:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-06 17:35:26 +0100 |
commit | b40c389a135778c5a2817732f4839bfaa7fe1776 (patch) | |
tree | 46f6c020cf3730ba2efbb6ce8271669597f41e0c /node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/Loader.java | |
parent | 3b6df7e9ae9950744c6b8401026388f483f9c3a2 (diff) | |
parent | ab9e6d39a300a395461d2c970278c309d667d4d3 (diff) |
Merge pull request #24769 from vespa-engine/bratseth/no-trafficv8.79.36
Handle no traffic
Diffstat (limited to 'node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/Loader.java')
-rw-r--r-- | node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/Loader.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/Loader.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/Loader.java index 39745b726a0..9158262b134 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/Loader.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/autoscale/Loader.java @@ -26,9 +26,12 @@ public class Loader { } /** Assign measured zero traffic in the same way as the system will. */ - public Duration zeroTraffic(int measurements) { + public Duration zeroTraffic(int measurements, int prodRegions) { try (var lock = fixture.tester().nodeRepository().applications().lock(fixture.applicationId())) { - var statusWithZeroLoad = fixture.application().status().withCurrentReadShare(0).withMaxReadShare(1); + var statusWithZeroLoad = fixture.application().status() + .withCurrentReadShare(0) + // the line below from TrafficShareUpdater + .withMaxReadShare(prodRegions < 2 ? 1.0 : 1.0 / ( prodRegions - 1.0)); fixture.tester().nodeRepository().applications().put(fixture.application().with(statusWithZeroLoad), lock); } return addQueryRateMeasurements(measurements, (n) -> 0.0); |