aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/vespa/model/application/validation/JvmHeapSizeValidator.java
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorn.christian@seime.no>2023-10-18 11:01:58 +0200
committerGitHub <noreply@github.com>2023-10-18 11:01:58 +0200
commit36406e8641540bc457ba98591c86309371524472 (patch)
tree08f012b8598c258cb6b4e73b062809099b0afbcf /config-model/src/main/java/com/yahoo/vespa/model/application/validation/JvmHeapSizeValidator.java
parentf6f141bf8d983f1b7b0e057c6e225de07dbda6a5 (diff)
parentbd84e40fb7b588ca32f1fb0016ba90ff7ee04584 (diff)
Merge pull request #28998 from vespa-engine/kkraune/locale-independent
Make code locale-independent
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/application/validation/JvmHeapSizeValidator.java')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/application/validation/JvmHeapSizeValidator.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/JvmHeapSizeValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/JvmHeapSizeValidator.java
index 510fff66c10..425a662bb2d 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/JvmHeapSizeValidator.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/JvmHeapSizeValidator.java
@@ -3,6 +3,7 @@
package com.yahoo.vespa.model.application.validation;
import com.yahoo.config.model.deploy.DeployState;
+import com.yahoo.text.Text;
import com.yahoo.vespa.model.VespaModel;
import java.util.logging.Level;
@@ -32,21 +33,20 @@ public class JvmHeapSizeValidator extends Validator {
double gbLimit = 0.6;
double availableMemoryGb = mp.availableMemoryGb().getAsDouble();
double modelCostGb = jvmModelCost / (1024D * 1024 * 1024);
- ds.getDeployLogger().log(Level.FINE, () -> "JVM: %d%% (limit: %d%%), %.2fGB (limit: %.2fGB), ONNX: %.2fGB"
- .formatted(mp.percentage(), percentLimit, availableMemoryGb, gbLimit, modelCostGb));
+ ds.getDeployLogger().log(Level.FINE, () -> Text.format("JVM: %d%% (limit: %d%%), %.2fGB (limit: %.2fGB), ONNX: %.2fGB",
+ mp.percentage(), percentLimit, availableMemoryGb, gbLimit, modelCostGb));
if (mp.percentage() < percentLimit) {
- throw new IllegalArgumentException(
- ("Allocated percentage of memory of JVM in cluster '%s' is too low (%d%% < %d%%). " +
+ throw new IllegalArgumentException(Text.format("Allocated percentage of memory of JVM in cluster '%s' is too low (%d%% < %d%%). " +
"Estimated cost of ONNX models is %.2fGB. Either use a node flavor with more memory or use less expensive models. " +
- "You may override this validation by specifying 'allocated-memory' (https://docs.vespa.ai/en/performance/container-tuning.html#jvm-heap-size).")
- .formatted(clusterId, mp.percentage(), percentLimit, modelCostGb));
+ "You may override this validation by specifying 'allocated-memory' (https://docs.vespa.ai/en/performance/container-tuning.html#jvm-heap-size).",
+ clusterId, mp.percentage(), percentLimit, modelCostGb));
}
if (availableMemoryGb < gbLimit) {
throw new IllegalArgumentException(
- ("Allocated memory to JVM in cluster '%s' is too low (%.2fGB < %.2fGB). " +
+ Text.format("Allocated memory to JVM in cluster '%s' is too low (%.2fGB < %.2fGB). " +
"Estimated cost of ONNX models is %.2fGB. Either use a node flavor with more memory or use less expensive models. " +
- "You may override this validation by specifying 'allocated-memory' (https://docs.vespa.ai/en/performance/container-tuning.html#jvm-heap-size).")
- .formatted(clusterId, availableMemoryGb, gbLimit, modelCostGb));
+ "You may override this validation by specifying 'allocated-memory' (https://docs.vespa.ai/en/performance/container-tuning.html#jvm-heap-size).",
+ clusterId, availableMemoryGb, gbLimit, modelCostGb));
}
}
});