Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Monitor ¶
type Monitor struct { sync.Mutex Id string // Statuses is the current status, by the nodes' ids Statuses map[string]monitoring.Status }
Monitor is a monitor for a service
func (*Monitor) SetStatusForNode ¶
func (monitor *Monitor) SetStatusForNode(id string, status monitoring.Status)
SetStatusForNode sets the status for a node by its id
func (*Monitor) Status ¶
func (monitor *Monitor) Status() *MonitorStatus
Status retrieves the current status of the monitored service
type MonitorStatus ¶
type MonitorStatus struct { // Statuses are the occurances for each observed status for the monitor Statuses map[monitoring.Status]int }
MonitorStatus is the status of a service, assessed by using all results from all cluster nodes
func (*MonitorStatus) Occurances ¶
func (monitorStatus *MonitorStatus) Occurances(status monitoring.Status) int
Occurances retrieves the number of observed statuses of the given type
type Origin ¶
type Origin struct { sync.Mutex Id string // Services are the services requested for monitoring by the origin, by their id Services map[string]*Service }
Origin is an origin node from which services originate
func (*Origin) AssertService ¶
AssertService retrieves a service by its id and creates it if it does not already exist
type Service ¶
type Service struct { sync.Mutex Id string // Monitors are the monitors configured for the service, by their id Monitors map[string]*Monitor }
Service is a monitored service
func (*Service) AssertMonitor ¶
AssertMonitor retrieves a monitor by its id and creates it if it does not already exist
func (*Service) GetMonitor ¶
GetMonitor retrieves a monitor by its id
func (*Service) Status ¶
func (service *Service) Status() monitoring.Status
Status retrieves the current status of the service, taking all monitors into account
type ServiceStatus ¶
type ServiceStatus struct { }
ServiceStatus is the status of a service, assessed by using all configured monitors
type Store ¶
type Store struct { sync.Mutex // Origins are all of the origins available in the store, by their id Origins map[string]*Origin }
Store is a central state storage for services and their statuses
func (*Store) AssertOrigin ¶
AssertOrigin retrieves an origin and creates it if it does not already exist
func (*Store) GetServices ¶
GetServices retrieves all configured services