Loading main/pom.xml +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ <parent> <artifactId>pgio-parent</artifactId> <groupId>com.ongres.pgio</groupId> <version>1.0.1</version> <version>1.0.3</version> </parent> <artifactId>main</artifactId> Loading main/src/main/java/com/ongres/pgio/main/Main.java +7 −4 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Loading @@ -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 { Loading Loading @@ -191,11 +194,11 @@ public class Main { "Run as a prometheus service (advanced option)") .availableIf("advanced"); parser.acceptsAll(Lists.newArrayList("prometheus-bind"), "The bind address of prometheus service (advanced option)") "The bind address of prometheus service, default is localhost (advanced option)") .availableIf("advanced") .withRequiredArg(); parser.acceptsAll(Lists.newArrayList("prometheus-port"), "The port of prometheus service (advanced option)") "The port of prometheus service, default is 9544 (advanced option)") .availableIf("advanced") .withRequiredArg(); parser.acceptsAll(Lists.newArrayList("ppid"), Loading main/src/main/java/com/ongres/pgio/main/config/Config.java +2 −2 Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ public class Config { private Optional<Integer> ppid = Optional.empty(); private boolean prometheusService; private InetAddress prometheusBind; private int prometheusPort = 8000; private int prometheusPort = 9544; private boolean noPrintHeader; private boolean showSystem; private boolean showOther; Loading @@ -122,7 +122,7 @@ public class Config { public Builder() { try { prometheusBind = InetAddress.getLocalHost(); prometheusBind = InetAddress.getByName("localhost"); } catch (UnknownHostException ex) { throw new RuntimeException(ex); } Loading pom.xml +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ <groupId>com.ongres.pgio</groupId> <artifactId>pgio-parent</artifactId> <version>1.0.1</version> <version>1.0.3</version> <packaging>pom</packaging> <prerequisites> Loading Loading
main/pom.xml +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ <parent> <artifactId>pgio-parent</artifactId> <groupId>com.ongres.pgio</groupId> <version>1.0.1</version> <version>1.0.3</version> </parent> <artifactId>main</artifactId> Loading
main/src/main/java/com/ongres/pgio/main/Main.java +7 −4 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Loading @@ -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 { Loading Loading @@ -191,11 +194,11 @@ public class Main { "Run as a prometheus service (advanced option)") .availableIf("advanced"); parser.acceptsAll(Lists.newArrayList("prometheus-bind"), "The bind address of prometheus service (advanced option)") "The bind address of prometheus service, default is localhost (advanced option)") .availableIf("advanced") .withRequiredArg(); parser.acceptsAll(Lists.newArrayList("prometheus-port"), "The port of prometheus service (advanced option)") "The port of prometheus service, default is 9544 (advanced option)") .availableIf("advanced") .withRequiredArg(); parser.acceptsAll(Lists.newArrayList("ppid"), Loading
main/src/main/java/com/ongres/pgio/main/config/Config.java +2 −2 Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ public class Config { private Optional<Integer> ppid = Optional.empty(); private boolean prometheusService; private InetAddress prometheusBind; private int prometheusPort = 8000; private int prometheusPort = 9544; private boolean noPrintHeader; private boolean showSystem; private boolean showOther; Loading @@ -122,7 +122,7 @@ public class Config { public Builder() { try { prometheusBind = InetAddress.getLocalHost(); prometheusBind = InetAddress.getByName("localhost"); } catch (UnknownHostException ex) { throw new RuntimeException(ex); } Loading
pom.xml +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ <groupId>com.ongres.pgio</groupId> <artifactId>pgio-parent</artifactId> <version>1.0.1</version> <version>1.0.3</version> <packaging>pom</packaging> <prerequisites> Loading