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 each_service_gets_separate_metrics_packets() {
        List<MetricsPacket> packets = metricsManager.getMetrics(testServices, Instant.EPOCH);
        assertEquals(2, packets.size());

        assertEquals("dummy0", packets.get(0).dimensions().get(toDimensionId("instance")));
        assertEquals(1, packets.get(0).metrics().get(toMetricId("c.test")));
        assertEquals(1.05, packets.get(0).metrics().get(toMetricId("val")));

        assertEquals("dummy1", packets.get(1).dimensions().get(toDimensionId("instance")));
        assertEquals(6, packets.get(1).metrics().get(toMetricId("c.test")));
        assertEquals(2.35, packets.get(1).metrics().get(toMetricId("val")));
    }