diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-11-01 12:36:05 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2022-11-01 12:36:05 +0100 |
commit | aba1d62aeb907003677cbe03133cb808b85a32ff (patch) | |
tree | d9e104d4ebf36b0b9e5dfa2b5dc60aaa5dc2a5bf /node-repository/src/main/java | |
parent | 1bfd169272b8af35740b14b2729e3bc96cd44961 (diff) |
Test with no traffic
Diffstat (limited to 'node-repository/src/main/java')
3 files changed, 11 insertions, 11 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/AllocatableClusterResources.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/AllocatableClusterResources.java index 552f67ba6d3..4e7504cd5af 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/AllocatableClusterResources.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/AllocatableClusterResources.java @@ -202,12 +202,14 @@ public class AllocatableClusterResources { if ( ! between(applicationLimits.min().nodeResources(), applicationLimits.max().nodeResources(), advertisedResources)) continue; if ( ! systemLimits.isWithinRealLimits(realResources, clusterSpec.type())) continue; + var candidate = new AllocatableClusterResources(wantedResources.with(realResources), advertisedResources, wantedResources, clusterSpec); - if (best.isEmpty() || candidate.preferableTo(best.get())) + if (best.isEmpty() || candidate.preferableTo(best.get())) { best = Optional.of(candidate); + } } return best; } diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterModel.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterModel.java index e6f2a1216f3..3025124b174 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterModel.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterModel.java @@ -214,7 +214,7 @@ public class ClusterModel { return nodes > 1 ? (groups == 1 ? 1 : groups - 1) : groups; } - /** Ideal cpu load must take the application traffic fraction into account */ + /** Ideal cpu load must take the application traffic fraction into account. */ private double idealCpuLoad() { double queryCpuFraction = queryCpuFraction(); @@ -238,7 +238,7 @@ public class ClusterModel { // Assumptions: 1) Write load is not organic so we should not grow to handle more. // (TODO: But allow applications to set their target write rate and size for that) // 2) Write load does not change in BCP scenarios. - return queryCpuFraction * 1 / growthRateHeadroom * 1 / trafficShiftHeadroom * idealQueryCpuLoad + + return queryCpuFraction * 1/growthRateHeadroom * 1/trafficShiftHeadroom * idealQueryCpuLoad + (1 - queryCpuFraction) * idealWriteCpuLoad; } diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/ApplicationPatcher.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/ApplicationPatcher.java index eee1d364c03..871f30570f5 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/ApplicationPatcher.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/ApplicationPatcher.java @@ -68,14 +68,12 @@ public class ApplicationPatcher implements AutoCloseable { } private Application applyField(Application application, String name, Inspector value) { - switch (name) { - case "currentReadShare" : - return application.with(application.status().withCurrentReadShare(asDouble(value))); - case "maxReadShare" : - return application.with(application.status().withMaxReadShare(asDouble(value))); - default : - throw new IllegalArgumentException("Could not apply field '" + name + "' on an application: No such modifiable field"); - } + return switch (name) { + case "currentReadShare" -> application.with(application.status().withCurrentReadShare(asDouble(value))); + case "maxReadShare" -> application.with(application.status().withMaxReadShare(asDouble(value))); + default -> throw new IllegalArgumentException("Could not apply field '" + name + + "' on an application: No such modifiable field"); + }; } private Double asDouble(Inspector field) { |