healthchecker

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthChecker

type HealthChecker interface {
	// Start will start the health checker, and returns a notification channel.
	// if the checker thinks the slave is unhealthy, it will send the timestamp
	// via the channel.
	Start() <-chan time.Time
	// Pause will pause the slave health checker.
	Pause()
	// Continue will continue the slave health checker with a new slave upid.
	Continue(slaveUPID *upid.UPID)
	// Stop will stop the health checker. it should be called only once during
	// the life span of the checker.
	Stop()
}

HealthChecker defines the interface of a health checker.

type SlaveHealthChecker

type SlaveHealthChecker struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

SlaveHealthChecker is for checking the slave's health.

func NewSlaveHealthChecker

func NewSlaveHealthChecker(slaveUPID *upid.UPID, threshold int, checkDuration time.Duration, timeout time.Duration) *SlaveHealthChecker

NewSlaveHealthChecker creates a slave health checker and return a notification channel. Each time the checker thinks the slave is unhealthy, it will send a notification through the channel.

func (*SlaveHealthChecker) Continue

func (s *SlaveHealthChecker) Continue(slaveUPID *upid.UPID)

Continue will continue the slave health checker with a new slave upid.

func (*SlaveHealthChecker) Pause

func (s *SlaveHealthChecker) Pause()

Pause will pause the slave health checker.

func (*SlaveHealthChecker) Start

func (s *SlaveHealthChecker) Start() <-chan time.Time

Start will start the health checker and returns the notification channel.

func (*SlaveHealthChecker) Stop

func (s *SlaveHealthChecker) Stop()

Stop will stop the slave health checker. It should be called only once during the life span of the checker.

Jump to

Keyboard shortcuts

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