diff options
Diffstat (limited to 'clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ResourceExhaustionCalculator.java')
-rw-r--r-- | clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ResourceExhaustionCalculator.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ResourceExhaustionCalculator.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ResourceExhaustionCalculator.java index 80b8a6110f1..c91c5dbeb8d 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ResourceExhaustionCalculator.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ResourceExhaustionCalculator.java @@ -37,9 +37,7 @@ public class ResourceExhaustionCalculator { int maxDescriptions = 3; String description = exhaustions.stream() .limit(maxDescriptions) - .map(n -> String.format("%s on node %s (%.3g > %.3g)", - n.resourceType, n.node.getIndex(), - n.resourceUsage.getUsage(), n.limit)) + .map(ResourceExhaustionCalculator::formatNodeResourceExhaustion) .collect(Collectors.joining(", ")); if (exhaustions.size() > maxDescriptions) { description += String.format(" (... and %d more)", exhaustions.size() - maxDescriptions); @@ -47,6 +45,14 @@ public class ResourceExhaustionCalculator { return ClusterStateBundle.FeedBlock.blockedWithDescription(description); } + private static String formatNodeResourceExhaustion(NodeResourceExhaustion n) { + return String.format("%s%s on node %s (%.3g > %.3g)", + n.resourceType, + (n.resourceUsage.getName() != null ? ":" + n.resourceUsage.getName() : ""), + n.node.getIndex(), + n.resourceUsage.getUsage(), n.limit); + } + public List<NodeResourceExhaustion> resourceExhaustionsFromHostInfo(Node node, HostInfo hostInfo) { List<NodeResourceExhaustion> exceedingLimit = null; for (var usage : hostInfo.getContentNode().getResourceUsage().entrySet()) { |