monitor

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxFrequencyPerCycle = 100
	MinCycle             = time.Minute
	MaxCycle             = time.Hour
	MinSyncInterval      = time.Second
	MaxSyncInterval      = time.Minute * 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CompletedConfig

type CompletedConfig struct {
	*Config
}

CompletedConfig is the completed configuration for Monitor.

func (CompletedConfig) NewMonitor

func (c CompletedConfig) NewMonitor() (Monitor, error)

type Config

type Config struct {
	MonitoringSyncInterval      time.Duration
	MonitoringCycle             time.Duration
	MonitoringFrequencyPerCycle int
}

Config is a structure used to configure a Monitor. Its members are sorted roughly in order of importance for composers.

func NewConfig

func NewConfig() *Config

NewConfig returns a Config struct with the default values.

func (*Config) Complete

func (c *Config) Complete() CompletedConfig

Complete fills in any fields not set that are required to have valid data and can be derived from other fields. If you're going to `ApplyOptions`, do that first. It's mutating the receiver.

type Monitor

type Monitor interface {
	Start() error
	Stop() error
	Report() SystemInfo
}

type SystemInfo

type SystemInfo struct {
	CpuUsePct  string
	MemUsePct  string
	DiskUsePct string
}

Jump to

Keyboard shortcuts

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