load

package
v0.0.0-...-73cb94f Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AverageStats

type AverageStats 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
}

AverageStats represents the system load averages over 1, 5, and 15 minutes.

type Linux

type Linux struct{}

Linux implements the Load interface for Linux.

func NewLinuxProvider

func NewLinuxProvider() *Linux

NewLinuxProvider factory to create a new Linux instance.

func (*Linux) GetAverageStats

func (l *Linux) GetAverageStats() (*AverageStats, error)

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() (*AverageStats, error)
}

Provider implements the methods to interact with various Load components.

type Ubuntu

type Ubuntu struct {
	AvgFn func() (*load.AvgStat, error)
}

Ubuntu implements the Mem interface for Ubuntu.

func NewUbuntuProvider

func NewUbuntuProvider() *Ubuntu

NewUbuntuProvider factory to create a new Ubuntu instance.

func (*Ubuntu) GetAverageStats

func (u *Ubuntu) GetAverageStats() (*AverageStats, error)

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.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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