@Test public void each_service_gets_separate_metrics_packets() { List<MetricsPacket> packets = metricsManager.getMetrics(testServices, Instant.EPOCH); assertThat(packets.size(), is(2)); assertThat(packets.get(0).dimensions().get(toDimensionId("instance")), is("dummy0")); assertThat(packets.get(0).metrics().get(toMetricId("c.test")), is(1.0)); assertThat(packets.get(0).metrics().get(toMetricId("val")), is(1.05)); assertThat(packets.get(1).dimensions().get(toDimensionId("instance")), is("dummy1")); assertThat(packets.get(1).metrics().get(toMetricId("c.test")), is(6.0)); assertThat(packets.get(1).metrics().get(toMetricId("val")), is(2.35)); }
public List<MetricsPacket> getMetrics(List<VespaService> services, Instant startTime) { return getMetricsAsBuilders(services, startTime).stream() .map(MetricsPacket.Builder::build) .collect(Collectors.toList()); }
MetricsManager { public List<MetricsPacket> getMetrics(List<VespaService> services, Instant startTime) { return getMetricsAsBuilders(services, startTime).stream() .map(MetricsPacket.Builder::build) .collect(Collectors.toList()); } }
MetricsManager { public List<MetricsPacket> getMetrics(List<VespaService> services, Instant startTime) { return getMetricsAsBuilders(services, startTime).stream() .map(MetricsPacket.Builder::build) .collect(Collectors.toList()); } MetricsManager(VespaServices vespaServices,
                          VespaMetrics vespaMetrics,
                          ExternalMetrics externalMetrics,
                          ApplicationDimensions applicationDimensions,
                          NodeDimensions nodeDimensions); }
MetricsManager { public List<MetricsPacket> getMetrics(List<VespaService> services, Instant startTime) { return getMetricsAsBuilders(services, startTime).stream() .map(MetricsPacket.Builder::build) .collect(Collectors.toList()); } 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(); }
MetricsManager { public List<MetricsPacket> getMetrics(List<VespaService> services, Instant startTime) { return getMetricsAsBuilders(services, startTime).stream() .map(MetricsPacket.Builder::build) .collect(Collectors.toList()); } 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();  }