diff options
author | gjoranv <gv@verizonmedia.com> | 2020-01-03 11:30:54 +0100 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2020-01-03 11:30:54 +0100 |
commit | ec6ae933e5179e6116feda2fe51d7277d89c8d55 (patch) | |
tree | 3fc6c02d65ab2b5adf60d2cccf9deb78885206aa /metrics-proxy | |
parent | 0c301c98d930a5e0a48b62bf8a5eda6abfc58257 (diff) |
Remove convenience method that did not take consumer argument.
Diffstat (limited to 'metrics-proxy')
2 files changed, 6 insertions, 11 deletions
diff --git a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/NodeMetricsClient.java b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/NodeMetricsClient.java index d1ff47f3c3f..8b397bc65f8 100644 --- a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/NodeMetricsClient.java +++ b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/NodeMetricsClient.java @@ -21,7 +21,6 @@ import java.util.List; import java.util.Map; import java.util.logging.Logger; -import static ai.vespa.metricsproxy.http.ValuesFetcher.DEFAULT_PUBLIC_CONSUMER_ID; import static com.yahoo.log.LogLevel.DEBUG; import static java.util.Collections.emptyList; @@ -47,16 +46,12 @@ public class NodeMetricsClient { private final Map<ConsumerId, Snapshot> snapshots = new HashMap<>(); private long snapshotsRetrieved = 0; - public NodeMetricsClient(HttpClient httpClient, Node node, Clock clock) { + NodeMetricsClient(HttpClient httpClient, Node node, Clock clock) { this.httpClient = httpClient; this.node = node; this.clock = clock; } - public List<MetricsPacket.Builder> getMetrics() { - return getMetrics(DEFAULT_PUBLIC_CONSUMER_ID); - } - public List<MetricsPacket.Builder> getMetrics(ConsumerId consumer) { var currentSnapshot = snapshots.get(consumer); if (currentSnapshot == null || currentSnapshot.isStale(clock) || currentSnapshot.metrics.isEmpty()) { diff --git a/metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/application/NodeMetricsClientTest.java b/metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/application/NodeMetricsClientTest.java index 6c319a4d74c..0c0b0749011 100644 --- a/metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/application/NodeMetricsClientTest.java +++ b/metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/application/NodeMetricsClientTest.java @@ -88,28 +88,28 @@ public class NodeMetricsClientTest { @Test public void metrics_are_retrieved_upon_first_request() { - List<MetricsPacket.Builder> metrics = nodeMetricsClient.getMetrics(); + List<MetricsPacket.Builder> metrics = nodeMetricsClient.getMetrics(DEFAULT_PUBLIC_CONSUMER_ID); assertEquals(1, nodeMetricsClient.snapshotsRetrieved()); assertEquals(4, metrics.size()); } @Test public void cached_metrics_are_used_when_ttl_has_not_expired() { - nodeMetricsClient.getMetrics(); + nodeMetricsClient.getMetrics(DEFAULT_PUBLIC_CONSUMER_ID); assertEquals(1, nodeMetricsClient.snapshotsRetrieved()); clock.advance(NodeMetricsClient.METRICS_TTL.minusMillis(1)); - nodeMetricsClient.getMetrics(); + nodeMetricsClient.getMetrics(DEFAULT_PUBLIC_CONSUMER_ID); assertEquals(1, nodeMetricsClient.snapshotsRetrieved()); } @Test public void metrics_are_refreshed_when_ttl_has_expired() { - nodeMetricsClient.getMetrics(); + nodeMetricsClient.getMetrics(DEFAULT_PUBLIC_CONSUMER_ID); assertEquals(1, nodeMetricsClient.snapshotsRetrieved()); clock.advance(NodeMetricsClient.METRICS_TTL.plusMillis(1)); - nodeMetricsClient.getMetrics(); + nodeMetricsClient.getMetrics(DEFAULT_PUBLIC_CONSUMER_ID); assertEquals(2, nodeMetricsClient.snapshotsRetrieved()); } |