stats

package
v0.0.0-...-e60a715 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertBytes

func ConvertBytes(bytes uint64) (string, string)

func FormatNumber

func FormatNumber(n int64) (string, string)

func GetCPUStats

func GetCPUStats() (cpu.TimesStat, error)

func GetMEMStats

func GetMEMStats() (mem.VirtualMemoryStat, error)

func GetNetworkStats

func GetNetworkStats() (net.IOCountersStat, error)

func GetSWAPStats

func GetSWAPStats() (mem.SwapMemoryStat, error)

Types

type ProcessInfo

type ProcessInfo struct {
	PID         int32  // Process ID
	Name        string // Process name
	Username    string
	Memory      uint64  // Memory usage in string format
	CPUPercent  float64 // CPU usage percentage
	RunningTime string
}

func GetProcesses

func GetProcesses(n int) ([]ProcessInfo, error)

Jump to

Keyboard shortcuts

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