public static NodeRepoStats computeOver(NodeRepository nodeRepository) {
        NodeList allNodes = nodeRepository.nodes().list();
        double totalCost = allNodes.hosts().stream().mapToDouble(host -> host.resources().cost()).sum();
        double totalAllocatedCost = allNodes.not().hosts().stream()
                                            .filter(node -> node.allocation().isPresent())
                                            .mapToDouble(node -> node.resources().cost()).sum();

        List<NodeTimeseries> allNodeTimeseries = nodeRepository.metricsDb().getNodeTimeseries(Duration.ofHours(1), Set.of());
        Pair<Load, Load> load = computeLoad(allNodes, allNodeTimeseries);
        List<ApplicationStats> applicationStats = computeApplicationStats(allNodes, allNodeTimeseries);
        return new NodeRepoStats(totalCost, totalAllocatedCost, load.getFirst(), load.getSecond(), applicationStats);
    }
Returns stats on each application, sorted by decreasing unutilized allocation measured in dollars per hour.
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepoStats.java