Ejemplo n.º 1
0
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")
}
Ejemplo n.º 2
0
func NewMonitor(opts ...monitor.Option) monitor.Monitor {
	return monitor.NewMonitor(opts...)
}