summaryrefslogtreecommitdiffstats
path: root/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/ApplicationMetricsRetriever.java
diff options
context:
space:
mode:
Diffstat (limited to 'metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/ApplicationMetricsRetriever.java')
-rw-r--r--metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/application/ApplicationMetricsRetriever.java12
1 files changed, 6 insertions, 6 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 87a0d7d8ad9..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);
@@ -104,17 +103,17 @@ public class ApplicationMetricsRetriever extends AbstractComponent implements Ru
pollThread.notifyAll();
}
try {
+ pollThread.join();
+ } catch (InterruptedException e) {}
+ try {
httpClient.close();
} catch (IOException e) {
log.warning("Failed closing httpclient: " + e);
}
- try {
- pollThread.join();
- } catch (InterruptedException e) {}
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();
}
}