monitor

package
v2.1.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: Apache-2.0, Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlushARPBinPath = "/var/vcap/packages/switchboard/bin/flusharp"
)

Variables

View Source
var UrlGetterProvider = HttpUrlGetterProvider

Functions

func ChooseActiveBackend

func ChooseActiveBackend(backendHealths map[*domain.Backend]*BackendStatus) *domain.Backend

Types

type ARPFlusher

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

func (ARPFlusher) RemoveEntry

func (a ARPFlusher) RemoveEntry(ip net.IP) error

type ArpEntryRemover

type ArpEntryRemover interface {
	RemoveEntry(ip net.IP) error
}

func NewARPFlusher

func NewARPFlusher(runner CmdRunner) ArpEntryRemover

type BackendStatus

type BackendStatus struct {
	Index    int
	Healthy  bool
	Counters *DecisionCounters
}

type Cluster

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

func NewCluster

func NewCluster(
	backends []*domain.Backend,
	healthcheckTimeout time.Duration,
	logger lager.Logger,
	arpEntryRemover ArpEntryRemover,
	activeBackendSubscribers []chan<- *domain.Backend,
	lookupIP func(string) ([]net.IP, error),
) *Cluster

func (*Cluster) Monitor

func (c *Cluster) Monitor(stopChan <-chan interface{})

func (*Cluster) QueryBackendHealth

func (c *Cluster) QueryBackendHealth(backend *domain.Backend, healthMonitor *BackendStatus, client UrlGetter)

func (*Cluster) SetupCounters

func (c *Cluster) SetupCounters() *DecisionCounters

type CmdRunner

type CmdRunner interface {
	Run(name string, cmd ...string) ([]byte, error)
}

type DecisionCounters

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

func NewDecisionCounters

func NewDecisionCounters() *DecisionCounters

func (*DecisionCounters) AddCondition

func (c *DecisionCounters) AddCondition(taskName string, predicate func() bool)

func (*DecisionCounters) GetCount

func (c *DecisionCounters) GetCount(name string) uint64

func (*DecisionCounters) IncrementCount

func (c *DecisionCounters) IncrementCount(name string)

func (*DecisionCounters) ResetCount

func (c *DecisionCounters) ResetCount(name string)

func (*DecisionCounters) Should

func (c *DecisionCounters) Should(taskName string) bool

type ExecCmdRunner

type ExecCmdRunner struct{}

func (*ExecCmdRunner) Run

func (r *ExecCmdRunner) Run(name string, arg ...string) ([]byte, error)

type Monitor

type Monitor interface {
	Monitor(<-chan interface{})
}

type Runner

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

func NewRunner

func NewRunner(monitor Monitor, logger lager.Logger) Runner

func (Runner) Run

func (pr Runner) Run(signals <-chan os.Signal, ready chan<- struct{}) error

type UrlGetter

type UrlGetter interface {
	Get(url string) (*http.Response, error)
}

func HttpUrlGetterProvider

func HttpUrlGetterProvider(healthcheckTimeout time.Duration) UrlGetter

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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