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;
    }
Returns the metrics for the given services. The empty list is returned if no services are given.

@param services the services to retrieve metrics for
@return metrics for all matching services
metrics-proxy/src/main/java/ai/vespa/metricsproxy/core/MetricsManager.java