system

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatBytes

func FormatBytes(b uint64) string

func FormatProcessName

func FormatProcessName(name string, maxLen int) string

func GetCPUUsage

func GetCPUUsage() (float64, error)

func SortByMemory

func SortByMemory(procs []ProcessInfo)

Types

type DiskInfo

type DiskInfo struct {
	Total uint64
	Used  uint64
	Free  uint64
}

func GetDiskUsage

func GetDiskUsage(path string) (DiskInfo, error)

func (DiskInfo) Percent

func (d DiskInfo) Percent() float64

type GPUInfo

type GPUInfo struct {
	Utilization float64
	UsedVRAM    uint64
	TotalVRAM   uint64
}

func GetGPUInfo

func GetGPUInfo() (GPUInfo, error)

func (GPUInfo) VRAMPercent

func (g GPUInfo) VRAMPercent() float64

type GPUProcess

type GPUProcess struct {
	PID      int
	UsedVRAM uint64
}

func GetGPUProcesses

func GetGPUProcesses() ([]GPUProcess, error)

type MemoryInfo

type MemoryInfo struct {
	TotalRAM     uint64
	UsedRAM      uint64
	AvailableRAM uint64
	TotalSwap    uint64
	UsedSwap     uint64
}

func GetMemoryInfo

func GetMemoryInfo() (MemoryInfo, error)

func (MemoryInfo) RAMPercent

func (m MemoryInfo) RAMPercent() float64

func (MemoryInfo) SwapPercent

func (m MemoryInfo) SwapPercent() float64

type ProcessInfo

type ProcessInfo struct {
	PID     int
	PPID    int
	Name    string
	State   string
	RSS     uint64
	CPUPerc float64
	Cmdline string
}

func GetKernelThreads

func GetKernelThreads(procs []ProcessInfo) []ProcessInfo

func GetOrphans

func GetOrphans(procs []ProcessInfo) []ProcessInfo

func GetProcesses

func GetProcesses() ([]ProcessInfo, error)

func GetZombies

func GetZombies(procs []ProcessInfo) []ProcessInfo

func TopN

func TopN(procs []ProcessInfo, n int) []ProcessInfo

Jump to

Keyboard shortcuts

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