monitor

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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