Documentation ¶
Index ¶
- Constants
- Variables
- func CurrentCpuUsage() float64
- func CurrentLoad() float64
- func CurrentMemoryUsage() int64
- func GetProcessMemoryStat() (int64, error)
- func InitCpuCollector(intervalMs uint32)
- func InitLoadCollector(intervalMs uint32)
- func InitMemoryCollector(intervalMs uint32)
- func SetSystemCpuUsage(cpuUsage float64)
- func SetSystemLoad(load float64)
- func SetSystemMemoryUsage(memoryUsage int64)
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.