Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
OnGres Inc.
pgio
Commits
1608bf81
Commit
1608bf81
authored
Feb 12, 2019
by
Matteo Melli
Browse files
Merge branch 'fix-prometheus-service' into 'master'
Version 1.0.3 See merge request ongresinc/pgio!10
parents
592f1e38
96fc2b37
Pipeline
#30295
passed with stage
in 1 minute and 13 seconds
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
main/pom.xml
View file @
1608bf81
...
...
@@ -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>
...
...
main/src/main/java/com/ongres/pgio/main/Main.java
View file @
1608bf81
...
...
@@ -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
IO
Exception
{
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
{
...
...
@@ -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"
),
...
...
main/src/main/java/com/ongres/pgio/main/config/Config.java
View file @
1608bf81
...
...
@@ -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
;
...
...
@@ -122,7 +122,7 @@ public class Config {
public
Builder
()
{
try
{
prometheusBind
=
InetAddress
.
get
L
ocal
H
ost
(
);
prometheusBind
=
InetAddress
.
get
ByName
(
"l
ocal
h
ost
"
);
}
catch
(
UnknownHostException
ex
)
{
throw
new
RuntimeException
(
ex
);
}
...
...
pom.xml
View file @
1608bf81
...
...
@@ -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>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment