Documentation
¶
Overview ¶
Package load provides system load average statistics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Darwin ¶
type Darwin struct {
provider.FactsAware
AvgFn func() (*load.AvgStat, error)
}
Darwin implements the Load interface for Darwin (macOS).
func NewDarwinProvider ¶
func NewDarwinProvider() *Darwin
NewDarwinProvider factory to create a new Darwin instance.
func (*Darwin) GetAverageStats ¶
GetAverageStats returns the system's load averages over 1, 5, and 15 minutes. It returns a AverageStats struct with load over 1, 5, and 15 minutes, and an error if something goes wrong.
type Debian ¶
type Debian struct {
provider.FactsAware
AvgFn func() (*load.AvgStat, error)
}
Debian implements the Mem interface for Debian.
func NewDebianProvider ¶
func NewDebianProvider() *Debian
NewDebianProvider factory to create a new Debian instance.
func (*Debian) GetAverageStats ¶
GetAverageStats returns the system's load averages over 1, 5, and 15 minutes. It returns a AverageStats struct with load over 1, 5, and 15 minutes, and an error if something goes wrong.
type Linux ¶
type Linux struct {
provider.FactsAware
}
Linux implements the Load interface for Linux.
func NewLinuxProvider ¶
func NewLinuxProvider() *Linux
NewLinuxProvider factory to create a new Linux instance.
func (*Linux) GetAverageStats ¶
GetAverageStats returns the system's load averages over 1, 5, and 15 minutes. It returns a AverageStats struct with load over 1, 5, and 15 minutes, and an error if something goes wrong.
type Provider ¶
type Provider interface {
// GetAverageStats retrieves the system load averages.
GetAverageStats() (*Result, error)
}
Provider implements the methods to interact with various Load components.
type Result ¶
type Result struct {
// Load average over the last 1 minute
Load1 float32
// Load average over the last 5 minutes
Load5 float32
// Load average over the last 15 minutes
Load15 float32
// Changed indicates whether system state was modified.
Changed bool `json:"changed"`
}
Result represents the system load averages over 1, 5, and 15 minutes.