public static ResourceUsageStats calculateFrom(Collection<NodeInfo> nodeInfos,
                                                   Map<String, Double> feedBlockLimits,
                                                   Optional<ClusterStateBundle.FeedBlock> feedBlock) {
        double maxDiskUsage = 0.0;
        double maxMemoryUsage = 0.0;
        for (NodeInfo info : nodeInfos) {
            if (info.isStorage()) {
                var node = info.getHostInfo().getContentNode();
                maxDiskUsage = Double.max(maxDiskUsage, resourceUsageOf(diskResource, node));
                maxMemoryUsage = Double.max(maxMemoryUsage, resourceUsageOf(memoryResource, node));
            }
        }
        double diskLimit = limitOf(diskResource, feedBlockLimits);
        double memoryLimit = limitOf(memoryResource, feedBlockLimits);
        return new ResourceUsageStats(maxDiskUsage / diskLimit,
                maxMemoryUsage / memoryLimit,
                calculateNodesAboveLimit(feedBlock),
                diskLimit, memoryLimit);
    }
Represents resource usage stats for the cluster that are exposed as metrics.
clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ResourceUsageStats.java