monitoring

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTLSConfig added in v1.2.0

func NewTLSConfig(conf config.Monitor) (*tls.Config, error)

NewTLSConfig create client TLS configuration

Types

type Monitor

type Monitor struct {
	ID         int
	Alias      string
	URL        url.URL
	Method     string
	Headers    []string
	Client     *http.Client
	Interval   time.Duration
	Timeout    time.Duration
	Validators []rule.Validator
	Ticker     *time.Ticker
	Labels     map[string]string
}

Monitor is a go routine in charge of the monitoring work.

func NewMonitor

func NewMonitor(id int, conf config.Monitor) (*Monitor, error)

NewMonitor create a new monitor

func (*Monitor) Start

func (m *Monitor) Start()

Start the monitor

func (*Monitor) Stop added in v1.1.0

func (m *Monitor) Stop()

Stop the monitor

func (Monitor) String

func (m Monitor) String() string

String to string convertion

func (*Monitor) Validate

func (m *Monitor) Validate() (time.Duration, error)

Validate the monitor endpoint by applying all validators

type Monitoring added in v1.1.0

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

Monitoring structure

func NewMonitoring added in v1.1.0

func NewMonitoring(conf config.Config) *Monitoring

NewMonitoring creates new monitoring instance

func (*Monitoring) RestartOnSDConfigChange added in v1.1.0

func (m *Monitoring) RestartOnSDConfigChange()

RestartOnSDConfigChange restart monitoring when Service Discover configuration change

func (*Monitoring) Start added in v1.1.0

func (m *Monitoring) Start() error

Start is charged to start all monitors

func (*Monitoring) Stop added in v1.1.0

func (m *Monitoring) Stop(ctx context.Context) error

Stop is charged to stop all monitors

Jump to

Keyboard shortcuts

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