Skip to content

Commit

Permalink
refactor: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
clambin committed Jan 16, 2022
1 parent 6b1a111 commit ccbc864
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pinger.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,16 @@ import (

func main() {
cfg := struct {
port int
endpoint string
debug bool
interval time.Duration
port int
debug bool
}{}
a := kingpin.New(filepath.Base(os.Args[0]), "pinger")

a.Version(version.BuildVersion)
a.HelpFlag.Short('h')
a.VersionFlag.Short('v')
a.Flag("port", "Metrics listener port").Default("8080").IntVar(&cfg.port)
a.Flag("endpoint", "Metrics listener endpoint").Default("/metrics").StringVar(&cfg.endpoint)
a.Flag("debug", "Log debug messages").BoolVar(&cfg.debug)
// a.Flag("interval", "Measurement interval").Default("5s").DurationVar(&cfg.interval)
hosts := a.Arg("hosts", "hosts to ping").Strings()

_, err := a.Parse(os.Args[1:])
Expand All @@ -49,7 +45,10 @@ func main() {
hosts = &values
}

log.WithField("hosts", *hosts).Infof("pinger %s", version.BuildVersion)
log.WithFields(log.Fields{
"hosts": *hosts,
"version": version.BuildVersion,
}).Info("pinger started")

p := pinger.New(*hosts)
prometheus.MustRegister(p)
Expand Down

0 comments on commit ccbc864

Please sign in to comment.