system

package
v0.19.3 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const MaxCPULoadResolution = loadPollIntervalWindows

MaxCPULoadResolution is the maximum guaranteed temporal resolution of the CPU load average. Calling CPULoad more often than MaxCPULoadResolution may yield duplicate results.

View Source
const UnknownOSInfo = "UNKNOWN"

UnknownOSInfo is returned as OSName, OSVersion or OSFlavour if the OS information could not be retrieved.

Variables

This section is empty.

Functions

func CPULoad added in v0.11.0

func CPULoad() (oneMinuteAvg, fiveMinuteAvg, fifteenMinuteAvg float64)

CPULoad retrieves the normalized 1-, 5-, and 15-minute averages of the CPU load percentage.

func FreeRAM added in v0.5.0

func FreeRAM() (uintptr, error)

FreeRAM returns the amount of free RAM available for allocation in bytes.

func FreeSwap added in v0.10.0

func FreeSwap() (uintptr, error)

FreeSwap returns the amount of free RAM available for allocation in bytes.

func TotalRAM added in v0.5.0

func TotalRAM() (uintptr, error)

TotalRAM returns the total amount of installed RAM in bytes.

func TotalSwap added in v0.10.0

func TotalSwap() (uintptr, error)

TotalSwap returns the amount of free RAM available for allocation in bytes.

Types

type Info

type Info struct {
	OSName    string   `json:"osName"`
	OSVersion string   `json:"osVersion"`
	OSFlavour string   `json:"osFlavour"`
	OSArch    arch.T   `json:"osArch"`
	Hostname  string   `json:"hostname"`
	IPs       []string `json:"ips"`
	NumCPUs   int      `json:"numCPUs"`
	TotalRAM  uintptr  `json:"totalRAM"`
	TotalSwap uintptr  `json:"totalSwap"`
}

Info contains information about the running system.

func GetInfo

func GetInfo() (*Info, error)

GetInfo retrieves the Info about the currently running system.

Jump to

Keyboard shortcuts

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