sysstat

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Trees

func Trees(rootPIDs []int) map[int]ProcStat

Trees reports the combined CPU and resident memory of each requested process and all of its descendants, from a single ps invocation. tmux pane pids are shells whose real work happens in child processes, so a tree sum is the only honest number. ps %cpu is a recent decaying average, which suits a 2s poll.

Types

type ProcStat

type ProcStat struct {
	CPUPercent float64
	RSS        uint64
	Procs      int
	OK         bool
}

type Snapshot

type Snapshot struct {
	CPUPercent  float64
	CPUOK       bool
	MemUsed     uint64
	MemTotal    uint64
	MemPercent  float64
	MemOK       bool
	SwapUsed    uint64
	SwapTotal   uint64
	SwapPercent float64
	SwapOK      bool
	DiskUsed    uint64
	DiskTotal   uint64
	DiskPercent float64
	DiskOK      bool
	NetSent     uint64
	NetRecv     uint64
	NetOK       bool
	CPUTemp     float64
	CPUTempOK   bool
	GPUTemp     float64
	GPUTempOK   bool
	SoCTemp     float64
	SoCTempOK   bool
}

func Sample

func Sample(diskPath string) Snapshot

Jump to

Keyboard shortcuts

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