public Map<String, SearchNodeMetricsAggregator> requestMetricsGroupedByCluster(Collection<URI> hosts) {
        Map<String, SearchNodeMetricsAggregator> clusterMetricsMap = new ConcurrentHashMap<>();
        for (URI uri : hosts) {
            addMetricsFromHost(uri, clusterMetricsMap);
        }
/*        long startTime = System.currentTimeMillis();
        Runnable retrieveMetricsJob = () ->
                hosts.parallelStream().forEach(host ->
                        addMetricsFromHost(host, clusterMetricsMap)
                );

        ForkJoinPool threadPool = new ForkJoinPool(10);
        threadPool.submit(retrieveMetricsJob);
        threadPool.shutdown();

        try {
            threadPool.awaitTermination(1, TimeUnit.MINUTES);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

        log.log(Level.FINE, () ->
                String.format("Proton metric retrieval for %d nodes took %d milliseconds", hosts.size(), System.currentTimeMillis() - startTime)
        );*/

        return clusterMetricsMap;
    }
@Test
    public void testMetricAggregation() throws IOException {
        List<URI> hosts = Stream.of(1, 2)
                .map(item -> URI.create("http://localhost:" + wireMock.port() + "/metrics" + item + "/v2/values"))
                .toList();

        stubFor(get(urlEqualTo("/metrics1/v2/values"))
                .willReturn(aResponse()
                        .withStatus(200)
                        .withBody(nodeMetrics("_1"))));

        stubFor(get(urlEqualTo("/metrics2/v2/values"))
                .willReturn(aResponse()
                        .withStatus(200)
                        .withBody(nodeMetrics("_2"))));

        String expectedClusterNameContent = "content/content/0/0";
        String expectedClusterNameMusic = "content/music/0/0";
        Map<String, SearchNodeMetricsAggregator> aggregatorMap = new ClusterSearchNodeMetricsRetriever().requestMetricsGroupedByCluster(hosts);

        compareAggregators(
                new SearchNodeMetricsAggregator()
                .addDocumentReadyCount(1275)
                .addDocumentActiveCount(1275)
                .addDocumentTotalCount(1275)
                .addDocumentDiskUsage(14781856)
                .addResourceDiskUsageAverage(0.0009083386306)
                .addResourceMemoryUsageAverage(0.0183488434436),
                aggregatorMap.get(expectedClusterNameContent)
        );

        compareAggregators(
                new SearchNodeMetricsAggregator()
                .addDocumentReadyCount(3008)
                .addDocumentActiveCount(3008)
                .addDocumentTotalCount(3008)
                .addDocumentDiskUsage(331157)
                .addResourceDiskUsageAverage(0.0000152263558)
                .addResourceMemoryUsageAverage(0.0156505524171),
                aggregatorMap.get(expectedClusterNameMusic)
        );

        wireMock.stop();
    }