public List<MetricsPacket> getMetrics(List<VespaService> services, Instant startTime) {
        MetricsPacket.Builder[] builderArray = getMetricsBuildersAsArray(services, startTime, null);
        List<MetricsPacket> metricsPackets = new ArrayList<>(builderArray.length);
        for (int i = 0; i < builderArray.length; i++) {
            metricsPackets.add(builderArray[i].build());
            builderArray[i] = null; // Set null to be able to GC the builder when packet has been created
        }
        return metricsPackets;
    }
@Test
    public void service_that_is_down_has_a_separate_metrics_packet() {
        // Reset to use only the service that is down
        var downService = new DownService(HealthMetric.getDown("No response"));
        List<VespaService> testServices = List.of(downService);
        MetricsManager metricsManager = TestUtil.createMetricsManager(new VespaServices(testServices),
                                                                      getMetricsConsumers(),getApplicationDimensions(), getNodeDimensions());

        List<MetricsPacket> packets = metricsManager.getMetrics(testServices, Instant.EPOCH);
        assertEquals(1, packets.size());
        assertTrue(packets.get(0).metrics().isEmpty());
        assertEquals(DownService.NAME, packets.get(0).dimensions().get(toDimensionId("instance")));
        assertEquals("value", packets.get(0).dimensions().get(toDimensionId("global")));
    }