core

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2018 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check struct {
	Data servicepb.Check

	Backoff    backoffs.Backoff
	Notifiers  []notifiers.Notifier
	Log        *log.Logger
	Store      storage.EventStorage
	Checker    checks.Checker
	Assertions []assertions.Asserter

	Stats *stats.CheckStats

	// send an alert only after N fails
	FailCountAlertThreshold int

	// continue to send fail alerts
	RepeatFailAlerts bool

	ConfigRank int
	// contains filtered or unexported fields
}

func NewCheck

func NewCheck(cfg checks.Config, eventStorage storage.EventStorage, preferences config.Preferences) (*Check, error)

func (*Check) AddNotifiers

func (c *Check) AddNotifiers(service *Service, names []string) error

func (*Check) DisplayState

func (c *Check) DisplayState() string

func (*Check) RecentMetrics

func (c *Check) RecentMetrics(metric string) string

func (*Check) Start

func (c *Check) Start()

func (*Check) Stop

func (c *Check) Stop()

func (*Check) Trigger added in v0.2.2

func (c *Check) Trigger()

type CheckState

type CheckState int
const (
	Disabled CheckState = iota
	Unknown
	Successful
	Failing
)

type ChecksArr

type ChecksArr []*Check

func (ChecksArr) Len

func (a ChecksArr) Len() int

func (ChecksArr) Less

func (a ChecksArr) Less(i, j int) bool

func (ChecksArr) Swap

func (a ChecksArr) Swap(i, j int)

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService() *Service

func (*Service) CheckByID

func (s *Service) CheckByID(id string) (*Check, error)

func (*Service) Checks

func (s *Service) Checks() []*Check

func (*Service) KeepRunning

func (s *Service) KeepRunning()

KeepRunning is called to wait indefinitely while the service runs.

func (*Service) RegisterCheck

func (s *Service) RegisterCheck(check *Check, sendAlerts []string, checkIdx int) error

func (*Service) RegisterNotifier

func (s *Service) RegisterNotifier(notifier notifiers.Notifier) error

func (*Service) Start

func (s *Service) Start()

Start starts the monitoring system, by starting each check. The service runs until a signal is received to stop the service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL