healthchecker

package
v0.21.3 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2015 License: Apache-2.0 Imports: 7 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 MockedHealthChecker

type MockedHealthChecker struct {
	mock.Mock
	// contains filtered or unexported fields
}

func NewMockedHealthChecker

func NewMockedHealthChecker() *MockedHealthChecker

NewMockedHealthChecker returns a new mocked health checker.

func (*MockedHealthChecker) Continue

func (m *MockedHealthChecker) Continue(slaveUPID *upid.UPID)

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

func (*MockedHealthChecker) Pause

func (m *MockedHealthChecker) Pause()

Pause will pause the slave health checker.

func (*MockedHealthChecker) Start

func (m *MockedHealthChecker) Start() <-chan time.Time

Start will start the checker and returns the notification channel.

func (*MockedHealthChecker) Stop

func (m *MockedHealthChecker) Stop()

Stop will stop the checker.

func (*MockedHealthChecker) TriggerUnhealthyEvent

func (m *MockedHealthChecker) TriggerUnhealthyEvent()

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