Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CpuTotalTicks ¶ added in v1.5.8
func CpuTotalTicks() uint64
CpuTotalTicks calculates the total MHz available across all cores.
Where asymetric cores are correctly detected, the total ticks is the sum of the performance across both core types.
Where asymetric cores are not correctly detected (such as Intel 13th gen), the total ticks available is over-estimated, as we assume all cores are P cores.
func RuntimeStats ¶ added in v0.8.0
RuntimeStats is used to return various runtime information
func SetCpuTotalTicks ¶ added in v1.5.8
func SetCpuTotalTicks(newCpuTotalTicks uint64)
Set the total ticks available across all cores.
Types ¶
type CpuStats ¶ added in v1.5.8
type CpuStats struct {
// contains filtered or unexported fields
}
CpuStats calculates cpu usage percentage
func NewCpuStats ¶ added in v1.5.8
func NewCpuStats() *CpuStats
NewCpuStats returns a cpu stats calculator
func (*CpuStats) Percent ¶ added in v1.5.8
Percent calculates the cpu usage percentage based on the current cpu usage and the previous cpu usage where usage is given as time in nanoseconds spend in the cpu
func (*CpuStats) TicksConsumed ¶ added in v1.5.8
TicksConsumed calculates the total ticks consumes by the process across all cpu cores