tool

package
v0.13.13 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ClkTck   = GetClkTck()
	PageSize = GetPageSize()
)

Functions

func CalculateCPUUtilization

func CalculateCPUUtilization(begin *Stat, now *Stat) (float64, error)

func FormatFloat64

func FormatFloat64(f float64, point int) float64

func GetClkTck

func GetClkTck() float64

func GetPageSize

func GetPageSize() float64

func GetProcessMemoryRSSKiloBytes added in v0.7.0

func GetProcessMemoryRSSKiloBytes(pid int) (float64, error)

func GetProcessRunningState added in v0.8.0

func GetProcessRunningState(pid int) (string, error)

func IsZombieProcess added in v0.8.0

func IsZombieProcess(pid int) (bool, error)

func ParseFloat64

func ParseFloat64(val string) float64

FIXME: return error

Types

type Stat

type Stat struct {
	Utime  float64
	Stime  float64
	Cutime float64
	Cstime float64
	Thread float64
	Start  float64
	Rss    float64
	Fds    float64
	Uptime float64
}

Please refer to https://man7.org/linux/man-pages/man5/proc.5.html for the metrics meanings

func GetProcessStat

func GetProcessStat(pid int) (*Stat, error)

Jump to

Keyboard shortcuts

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