aboutsummaryrefslogtreecommitdiffstats
path: root/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-09-21 23:22:40 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2021-09-21 23:22:40 +0200
commit643c51d6d7fce92d5f0703acf9e09e25a7408337 (patch)
tree9e94b145b338cb030aa2e5861ffb88ec2513165a /metrics-proxy/src/main/java/ai/vespa/metricsproxy/http
parentadaa583b50c1d63c04c7dd9643416a6d4744ae45 (diff)
Do not fetch metrics for default consumer unless explicitly asked to do so.
Diffstat (limited to 'metrics-proxy/src/main/java/ai/vespa/metricsproxy/http')
-rw-r--r--metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/ApplicationMetricsRetriever.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/ApplicationMetricsRetriever.java b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/ApplicationMetricsRetriever.java
index 1bbda1a463c..2603b9025c2 100644
--- a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/ApplicationMetricsRetriever.java
+++ b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/ApplicationMetricsRetriever.java
@@ -63,7 +63,6 @@ public class ApplicationMetricsRetriever extends AbstractComponent implements Ru
taskTimeout = timeout(clients.size());
stopped = false;
consumerSet = new HashSet<>();
- consumerSet.add(defaultMetricsConsumerId);
httpClient.start();
pollThread = new Thread(this, "metrics-poller");
pollThread.setDaemon(true);
@@ -114,7 +113,7 @@ public class ApplicationMetricsRetriever extends AbstractComponent implements Ru
super.deconstruct();
}
- public Map<Node, List<MetricsPacket>> getMetrics() {
+ Map<Node, List<MetricsPacket>> getMetrics() {
return getMetrics(defaultMetricsConsumerId);
}
@@ -141,7 +140,8 @@ public class ApplicationMetricsRetriever extends AbstractComponent implements Ru
}
long before = pollCount;
pollThread.notifyAll();
- while (pollCount == before) {
+ while (pollCount <= before + 1) {
+ pollThread.notifyAll();
pollThread.wait();
}
}