diff options
| author | Patrick Spek <p.spek@tyil.nl> | 2024-11-27 14:33:53 +0100 |
|---|---|---|
| committer | Patrick Spek <p.spek@tyil.nl> | 2024-11-27 14:33:53 +0100 |
| commit | 3ced80875717eb77777946ac0a48f45c224eb59f (patch) | |
| tree | 94acea291c34478d7a3a14938940289599204216 | |
| parent | 3cb78f4ccce184015670843ce027075dac59c559 (diff) | |
| download | fsdir-3ced80875717eb77777946ac0a48f45c224eb59f.tar.gz fsdir-3ced80875717eb77777946ac0a48f45c224eb59f.tar.bz2 | |
Add interval optionv1.0.0
| -rw-r--r-- | main.go | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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() } } |
