stats

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCpuStats

func GetCpuStats() *linux.CPUStat

func GetDiskInfo

func GetDiskInfo() *linux.Disk

func GetLoadAvg

func GetLoadAvg() *linux.LoadAvg

func GetMemoryInfo

func GetMemoryInfo() *linux.MemInfo

Types

type Stats

type Stats struct {
	MemStats  *linux.MemInfo
	DiskStats *linux.Disk
	CpuStats  *linux.CPUStat
	LoadStats *linux.LoadAvg

	// brought these out into their own fields since they are reported by the worker
	TaskCount       int
	CpuUsage        float64 // [0, 1]
	Cores           int
	MemoryAllocated int64 // bytes reserved by the worker's running tasks
}

func GetStats

func GetStats() *Stats

func (*Stats) CpuUsageSplit

func (s *Stats) CpuUsageSplit() (idle uint64, nonIdle uint64)

func (*Stats) DiskFree

func (s *Stats) DiskFree() uint64

func (*Stats) DiskTotal

func (s *Stats) DiskTotal() uint64

func (*Stats) DiskUsed

func (s *Stats) DiskUsed() uint64

func (*Stats) MemAvailableKb

func (s *Stats) MemAvailableKb() uint64

func (*Stats) MemTotalKb

func (s *Stats) MemTotalKb() uint64

func (*Stats) MemUsedKb

func (s *Stats) MemUsedKb() uint64

func (*Stats) MemUsedPercent

func (s *Stats) MemUsedPercent() uint64

Jump to

Keyboard shortcuts

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