diff options
author | Kristian Aune <kraune@verizonmedia.com> | 2021-03-19 10:10:25 +0100 |
---|---|---|
committer | Kristian Aune <kraune@verizonmedia.com> | 2021-03-19 10:10:25 +0100 |
commit | 11c35ba25cea323896c9068b9781cf1e60be1d10 (patch) | |
tree | 6516f29e033a25648e9c80c44a20fbe026125a2b /clustercontroller-core | |
parent | 2dbcab338e1289d45eca0007f43c4324f028b25f (diff) |
use US locale
Diffstat (limited to 'clustercontroller-core')
2 files changed, 9 insertions, 7 deletions
diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/NodeResourceExhaustion.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/NodeResourceExhaustion.java index 8d0a873a801..531e29344a6 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/NodeResourceExhaustion.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/NodeResourceExhaustion.java @@ -5,6 +5,7 @@ import com.yahoo.jrt.Spec; import com.yahoo.vdslib.state.Node; import com.yahoo.vespa.clustercontroller.core.hostinfo.ResourceUsage; +import java.util.Locale; import java.util.Objects; /** @@ -46,22 +47,22 @@ public class NodeResourceExhaustion { } public String toExhaustionAddedDescription() { - return String.format("%s (%.3g > %.3g)", makeDescriptionPrefix(), resourceUsage.getUsage(), limit); + return String.format(Locale.US, "%s (%.3g > %.3g)", makeDescriptionPrefix(), resourceUsage.getUsage(), limit); } public String toExhaustionRemovedDescription() { - return String.format("%s (<= %.3g)", makeDescriptionPrefix(), limit); + return String.format(Locale.US, "%s (<= %.3g)", makeDescriptionPrefix(), limit); } public String toShorthandDescription() { - return String.format("%s%s %.3g > %.3g", + return String.format(Locale.US, "%s%s %.3g > %.3g", resourceType, (resourceUsage.getName() != null ? ":" + resourceUsage.getName() : ""), resourceUsage.getUsage(), limit); } private String makeDescriptionPrefix() { - return String.format("%s%s on node %d [%s]", + return String.format(Locale.US, "%s%s on node %d [%s]", resourceType, (resourceUsage.getName() != null ? ":" + resourceUsage.getName() : ""), node.getIndex(), diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/FeedBlockUtil.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/FeedBlockUtil.java index 65199aa9957..46c57019b46 100644 --- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/FeedBlockUtil.java +++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/FeedBlockUtil.java @@ -8,6 +8,7 @@ import com.yahoo.vespa.clustercontroller.core.hostinfo.ResourceUsage; import java.util.Arrays; import java.util.LinkedHashSet; +import java.util.Locale; import java.util.Map; import java.util.Objects; import java.util.Set; @@ -78,11 +79,11 @@ public class FeedBlockUtil { static String createResourceUsageJson(Set<UsageDetails> usages) { // We deal only in the finest of manual JSON string building technologies(tm). String usageInnerJson = usages.stream() - .map(u -> String.format("\"%s\":{\"usage\": %.3g%s}", + .map(u -> String.format(Locale.US, "\"%s\":{\"usage\": %.3g%s}", u.type, u.usage, - (u.name != null ? String.format(",\"name\":\"%s\"", u.name) : ""))) + (u.name != null ? String.format(Locale.US, ",\"name\":\"%s\"", u.name) : ""))) .collect(Collectors.joining(",")); - return String.format("{\"content-node\":{\"resource-usage\":{%s}}}", usageInnerJson); + return String.format(Locale.US, "{\"content-node\":{\"resource-usage\":{%s}}}", usageInnerJson); } static NodeResourceExhaustion exhaustion(int index, String type) { |