summaryrefslogtreecommitdiffstats
path: root/config-provisioning
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2021-01-19 14:00:03 +0100
committerJon Bratseth <bratseth@gmail.com>2021-01-19 14:00:03 +0100
commit9a1a429a5accd99a8ebf73dc2232bd46a5ef322b (patch)
treeeea3ad54337d77b223a7684806051d2223231e21 /config-provisioning
parentccb0e462b5cd0d6fc8fa78ff12bfd0784a29202e (diff)
Suggest only when useful
- Closes a loophole where the suggestion made will be lower than the current allocation if the current allocation is the max need observed over the last week. - Since we now store the suggestion even if it is current we check at read time whether to suggest, and then also refrain from making suggestions inside the autoscaling interval.
Diffstat (limited to 'config-provisioning')
-rw-r--r--config-provisioning/src/main/java/com/yahoo/config/provision/ClusterResources.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterResources.java b/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterResources.java
index 7f7357ea77f..d4c52b97f45 100644
--- a/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterResources.java
+++ b/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterResources.java
@@ -64,6 +64,11 @@ public class ClusterResources {
return new ClusterResources(nodes, groups, nodeResources.justNumbers());
}
+ /** Returns the standard cost of these resources, in dollars per hour */
+ public double cost() {
+ return nodes * nodeResources.cost();
+ }
+
@Override
public boolean equals(Object o) {
if (o == this) return true;