diff options
Diffstat (limited to 'node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterModel.java')
-rw-r--r-- | node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterModel.java | 20 |
1 files changed, 13 insertions, 7 deletions
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 abcd626e64a..ae18e7ffb91 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 @@ -152,8 +152,18 @@ public class ClusterModel { return (int)Math.ceil((double)nodeCount() / groupCount()); } - /** Returns the relative load adjustment given these nodes+groups relative to node nodes+groups in this. */ - public Load loadWith(int nodes, int groups) { + /** Returns the relative load adjustment accounting for redundancy in this. */ + public Load redundancyAdjustment() { + return loadWith(nodeCount(), groupCount()); + } + + /** + * Returns the relative load adjustment accounting for redundancy given these nodes+groups + * relative to node nodes+groups in this. + */ + public Load loadWith(int trueNodes, int trueGroups) { + int nodes = nodesAdjustedForRedundancy(trueNodes, trueGroups); + int groups = groupsAdjustedForRedundancy(trueNodes, trueGroups); if (clusterSpec().type() == ClusterSpec.Type.content) { // load scales with node share of content int groupSize = nodes / groups; @@ -179,11 +189,7 @@ public class ClusterModel { * if one of the nodes go down. */ public Load idealLoad() { - int nodes = nodeCount(); - int groups = groupCount(); - return new Load(idealCpuLoad(), idealMemoryLoad, idealDiskLoad()) - .divide(loadWith(nodesAdjustedForRedundancy(nodes, groups), - groupsAdjustedForRedundancy(nodes, groups))); + return new Load(idealCpuLoad(), idealMemoryLoad, idealDiskLoad()).divide(redundancyAdjustment()); } public int nodesAdjustedForRedundancy(int nodes, int groups) { |