system_metric

package
v1.10.4 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotRetrievedLoadValue     float64 = -1.0
	NotRetrievedCpuUsageValue float64 = -1.0
	NotRetrievedMemoryValue   int64   = -1
)

Variables

View Source
var (
	CurrentPID = os.Getpid()

	TotalMemorySize = getTotalMemorySize()
)

Functions

func CurrentCpuUsage

func CurrentCpuUsage() float64

func CurrentLoad

func CurrentLoad() float64

func CurrentMemoryUsage

func CurrentMemoryUsage() int64

func GetProcessMemoryStat

func GetProcessMemoryStat() (int64, error)

GetProcessMemoryStat gets current process's memory usage in Bytes

func InitCpuCollector

func InitCpuCollector(intervalMs uint32)

func InitLoadCollector

func InitLoadCollector(intervalMs uint32)

func InitMemoryCollector

func InitMemoryCollector(intervalMs uint32)

func SetSystemCpuUsage

func SetSystemCpuUsage(cpuUsage float64)

Note: SetSystemCpuUsage is used for unit test, the user shouldn't call this function.

func SetSystemLoad

func SetSystemLoad(load float64)

Note: SetSystemLoad is used for unit test, the user shouldn't call this function.

func SetSystemMemoryUsage

func SetSystemMemoryUsage(memoryUsage int64)

Note: SetSystemCpuUsage is used for unit test, the user shouldn't call this function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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