MetricsManager { public String getMetricsByConfigId(String configId) { List<VespaService> services = vespaServices.getInstancesById(configId); vespaServices.updateServices(services); return vespaMetrics.getMetricsAsString(services); } MetricsManager(VespaServices vespaServices,
                          VespaMetrics vespaMetrics,
                          ExternalMetrics externalMetrics,
                          ApplicationDimensions applicationDimensions,
                          NodeDimensions nodeDimensions); String getMetricNamesForServiceAndConsumer(String service, ConsumerId consumer); String getMetricsByConfigId(String configId); List<MetricsPacket> getMetrics(List<VespaService> services, Instant startTime); List<MetricsPacket.Builder> getMetricsAsBuilders(List<VespaService> services, Instant startTime); List<MetricsPacket> getHealthMetrics(List<VespaService> services); void setExtraMetrics(List<MetricsPacket.Builder> packets); Map<DimensionId, String> getExtraDimensions(); void purgeExtraMetrics(); String getAllVespaServices();  }
@Test public void verify_expected_output_from_getMetricsById() { String dummy0Metrics = metricsManager.getMetricsByConfigId(SERVICE_0_ID); assertThat(dummy0Metrics, containsString("'dummy.id.0'.val=1.050")); assertThat(dummy0Metrics, containsString("'dummy.id.0'.c_test=1")); String dummy1Metrics = metricsManager.getMetricsByConfigId(SERVICE_1_ID); assertThat(dummy1Metrics, containsString("'dummy.id.1'.val=2.350")); assertThat(dummy1Metrics, containsString("'dummy.id.1'.c_test=6")); }