system_health

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CWAGSystemHealthProvider

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

CWAGSystemHealthProvider defines a system health provider.

func NewCWAGSystemHealthProvider

func NewCWAGSystemHealthProvider(eth string) (*CWAGSystemHealthProvider, error)

NewCWAGSystemHealthProvider creates a new CWAGSystemHealthProvider with initialized iptables.

func (*CWAGSystemHealthProvider) Disable

func (c *CWAGSystemHealthProvider) Disable() error

Disable adds an ICMP DROP rule from iptables for the configured interface. If the iptables rule already exists, Disable has no effect.

func (*CWAGSystemHealthProvider) Enable

func (c *CWAGSystemHealthProvider) Enable() error

Enable removes the ICMP DROP rule from iptables for the configured interface. If the iptables rule doesn't exist, Enable has no effect.

func (*CWAGSystemHealthProvider) GetSystemStats

func (c *CWAGSystemHealthProvider) GetSystemStats() (*SystemStats, error)

GetSystemStats collects and return the stats defined in SystemStats.

type SystemHealth

type SystemHealth interface {
	// GetSystemStats provides system level health stats
	GetSystemStats() (*SystemStats, error)

	// Disable allows the disabling of system level functionality. It is
	// up to implementors to determine specific functionality.
	Disable() error

	// Enable allows the enabling of system level functionality. It is
	// up to implementors to determine specific functionality.
	Enable() error
}

SystemHealth defines an interface to fetch system health and enable/disable functionality necessary for promotion/demotion from failovers

type SystemStats

type SystemStats struct {
	CpuUtilPct float32
	MemUtilPct float32
}

SystemsStats define the metrics this provider will collect.

Jump to

Keyboard shortcuts

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