heartbeet/main.go

24 lines
411 B
Go
Raw Permalink Normal View History

2019-08-31 12:23:02 -04:00
package main
import (
"flag"
2019-09-01 10:29:16 -04:00
2020-09-11 12:05:45 -04:00
"git.dcpri.me/some-fancy-tools/heartbeet/poller"
2019-08-31 12:23:02 -04:00
)
var (
2019-09-11 01:56:09 -04:00
period poller.PeriodValue
argument string
2019-08-31 12:23:02 -04:00
)
func init() {
2019-09-01 10:29:16 -04:00
// Add and parse flags passed to script
flag.Var(&period, "period", "Period to send metric at")
2019-09-11 01:56:09 -04:00
flag.StringVar(&argument, "argument", "STATE_CODE", "Argument Variable name")
2019-08-31 12:23:02 -04:00
flag.Parse()
}
func main() {
2019-09-11 01:56:09 -04:00
poller.StartTicker(period.Duration, argument)
2019-08-31 12:23:02 -04:00
}