public static ContentClusterStats generate(Distributor distributor) {
        Map<Integer, ContentNodeStats> mapToNodeStats = new HashMap<>();
        for (StorageNode storageNode : distributor.getStorageNodes()) {
            mapToNodeStats.put(storageNode.getIndex(), new ContentNodeStats(storageNode));
        }
        long docsTotal  = Optional.ofNullable(distributor.documentCountTotalOrNull()).orElse(0L);
        long bytesTotal = Optional.ofNullable(distributor.bytesTotalOrNull()).orElse(0L);
        return new ContentClusterStats(docsTotal, bytesTotal, mapToNodeStats);
    }
Class used to create a StorageNodeStatsContainer from HostInfo.

@author hakonhall
clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/hostinfo/StorageNodeStatsBridge.java