Commit aec3cac2 authored by Matteo Melli's avatar Matteo Melli

Fixed prometheus service exit without starting

parent 592f1e38
......@@ -31,7 +31,6 @@ import com.ongres.pgio.main.stats.serializer.StatSerializer;
import com.ongres.pgio.main.version.Version;
import fi.iki.elonen.NanoHTTPD;
import joptsimple.OptionException;
import joptsimple.OptionParser;
import joptsimple.OptionSet;
......@@ -48,6 +47,7 @@ import java.time.Duration;
import java.time.Instant;
import java.util.Optional;
import java.util.Scanner;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.function.Function;
......@@ -138,9 +138,12 @@ public class Main {
return message;
}
private static void runPrometheusService(Config config) throws IOException {
private static void runPrometheusService(Config config) throws Exception {
PrometheusService service = new PrometheusService(config);
service.start(NanoHTTPD.SOCKET_READ_TIMEOUT, false);
while (true) {
TimeUnit.MICROSECONDS.sleep(20);
}
}
private static void runCollector(Config config) throws Exception, InterruptedException {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment