Documentation ¶
Overview ¶
Package monitor is an interface for monitoring.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HealthCheckTopic = "micro.monitor.healthcheck" StatusTopic = "micro.monitor.status" StatsTopic = "micro.monitor.stats" )
View Source
var ( ErrAlreadyExists = errors.New("already exists") ErrNotAvailable = errors.New("not available") )
Functions ¶
func ClientWrapper ¶
func HandlerWrapper ¶
func HandlerWrapper(m Monitor) server.HandlerWrapper
Types ¶
type Checker ¶
type Checker interface { NewHealthChecker(id, desc string, fn HealthCheck) HealthChecker Register(HealthChecker) error Deregister(HealthChecker) error HealthChecks() ([]HealthChecker, error) }
Checker interface allows creation of healthchecks
type HealthCheck ¶
type HealthChecker ¶
type HealthChecker interface { // Unique id of the healthcheck Id() string // Description of what the healthcheck does Description() string // Runs the the healthcheck Run() (map[string]string, error) // Returns the status of the last run // Better where the healthcheck is expensive to run Status() (map[string]string, error) }
represents a healthcheck function
type Monitor ¶
The monitor aggregates, observes and publishes information about the current process. This includes status; started/running/stopped, stats; cpu, memory, runtime and healthchecks.
func NewMonitor ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.