aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2024-11-27 14:33:53 +0100
committerPatrick Spek <p.spek@tyil.nl>2024-11-27 14:33:53 +0100
commit3ced80875717eb77777946ac0a48f45c224eb59f (patch)
tree94acea291c34478d7a3a14938940289599204216
parent3cb78f4ccce184015670843ce027075dac59c559 (diff)
downloadfsdir-3ced80875717eb77777946ac0a48f45c224eb59f.tar.gz
fsdir-3ced80875717eb77777946ac0a48f45c224eb59f.tar.bz2
Add interval optionv1.0.0
-rw-r--r--main.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/main.go b/main.go
index 1f5c201..2e3a136 100644
--- a/main.go
+++ b/main.go
@@ -16,10 +16,11 @@ import (
)
var (
- path string
- httpPort int
httpHost string
+ httpPort int
+ interval int
namespace string
+ path string
subsystem string
gauges map[string]*prometheus.GaugeVec
@@ -27,10 +28,11 @@ var (
func main() {
// Set options
- flag.StringVar(&path, "path", "", "The path to export metrics of")
- flag.IntVar(&httpPort, "port", 9091, "The path to export metrics of")
flag.StringVar(&httpHost, "host", "[::]", "The path to export metrics of")
+ flag.IntVar(&httpPort, "port", 9091, "The path to export metrics of")
+ flag.IntVar(&interval, "interval", 10, "The path to export metrics of")
flag.StringVar(&namespace, "namespace", "fsdir_exporter", "Namespace to use for the Prometheus metrics")
+ flag.StringVar(&path, "path", "", "The path to export metrics of")
flag.StringVar(&subsystem, "subsystem", "", "Subsystem to use for the Prometheus metrics")
flag.Parse()
@@ -136,7 +138,7 @@ func update() {
}
func updateLoop() {
- for range time.Tick(time.Duration(10) * time.Second) {
+ for range time.Tick(time.Duration(interval) * time.Second) {
update()
}
}