aboutsummaryrefslogtreecommitdiffstats
path: root/node-repository
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@vespa.ai>2023-06-05 23:18:36 +0200
committerJon Bratseth <bratseth@vespa.ai>2023-06-05 23:18:36 +0200
commit76e17a0deb9afd901d6c9157fc7e26e4a5aa8850 (patch)
tree1105d9db2b6a3ad8b8bee8ba8887c4ad35129fa8 /node-repository
parentb8e508c6d0bcd99518784e66411c1beb9dc4d823 (diff)
Refactor: Reorder some methods
Diffstat (limited to 'node-repository')
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/ClusterModel.java39
1 files changed, 18 insertions, 21 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 b6b31d9c34f..dac9a0f3518 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
@@ -121,12 +121,29 @@ public class ClusterModel {
public Application application() { return application; }
public ClusterSpec clusterSpec() { return clusterSpec; }
- public Cluster cluster() { return cluster; }
+ private ClusterNodesTimeseries nodeTimeseries() { return nodeTimeseries; }
+ private ClusterTimeseries clusterTimeseries() { return clusterTimeseries; }
+
+ /** Returns the instant this model was created. */
+ public Instant at() { return at;}
public boolean isEmpty() {
return nodeTimeseries().isEmpty();
}
+ /** Returns the predicted duration of a rescaling of this cluster */
+ public Duration scalingDuration() { return scalingDuration; }
+
+ /** Returns the average of the peak load measurement in each dimension, from each node. */
+ public Load peakLoad() {
+ return nodeTimeseries().peakLoad();
+ }
+
+ /** Returns the relative load adjustment accounting for redundancy in this. */
+ public Load redundancyAdjustment() {
+ return loadWith(nodeCount(), groupCount());
+ }
+
/** Returns the relative load adjustment that should be made to this cluster given available measurements. */
public Load loadAdjustment() {
if (nodeTimeseries().measurementsPerNode() < 0.5) return Load.one(); // Don't change based on very little data
@@ -162,19 +179,6 @@ public class ClusterModel {
return Duration.ofMinutes(5);
}
- /** Returns the predicted duration of a rescaling of this cluster */
- public Duration scalingDuration() { return scalingDuration; }
-
- /** Returns the average of the peak load measurement in each dimension, from each node. */
- public Load peakLoad() {
- return nodeTimeseries().peakLoad();
- }
-
- /** 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.
@@ -232,9 +236,6 @@ public class ClusterModel {
cpu.costPerQuery().orElse(0));
}
- /** Returns the instant this model was created. */
- public Instant at() { return at;}
-
private Load adjustQueryDependentIdealLoadByBcpGroupInfo(Load ideal) {
double currentClusterTotalVcpuPerGroup = nodes.not().retired().first().get().resources().vcpu() * groupSize();
@@ -256,10 +257,6 @@ public class ClusterModel {
return lastCompletion.get().isAfter(clock.instant().minus(period));
}
- private ClusterNodesTimeseries nodeTimeseries() { return nodeTimeseries; }
-
- private ClusterTimeseries clusterTimeseries() { return clusterTimeseries; }
-
/**
* Returns the predicted max query growth rate per minute as a fraction of the average traffic
* in the scaling window.