func main() { cmd.Init() m := monitor.NewMonitor( monitor.Interval(time.Second), ) defer m.Close() hc1 := m.NewHealthChecker("go.micro.healthcheck.ping", "This is a ping healthcheck that succeeds", success) hc2 := m.NewHealthChecker("go.micro.healthcheck.pong", "This is a pong healthcheck that fails", failure) m.Register(hc1) m.Register(hc2) go record(m) <-time.After(time.Second * 10) fmt.Println("Stopping monitor") }
func NewMonitor(opts ...monitor.Option) monitor.Monitor { return monitor.NewMonitor(opts...) }