load

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 4 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

Overview

Package load reads the load averages of the host.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gohai added in v0.3.0

type Gohai struct {
	// Sources are what the collector reads. A zero field is the real
	// host's.
	Sources source.Sources
}

Gohai reads the host's load averages with gohai's load collector, on every Linux family and on macOS.

func New added in v0.3.0

func New() *Gohai

New returns a provider that reads the real host.

func (*Gohai) GetAverageStats added in v0.3.0

func (g *Gohai) GetAverageStats() (*Result, error)

GetAverageStats is the 1, 5 and 15 minute load averages.

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.

Directories

Path Synopsis
Package mocks provides mock implementations for testing.
Package mocks provides mock implementations for testing.

Jump to

Keyboard shortcuts

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