Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CpuTotalTicks ¶
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 ¶
RuntimeStats is used to return various runtime information
func SetCpuTotalTicks ¶
func SetCpuTotalTicks(newCpuTotalTicks uint64)
Set the total ticks available across all cores.
Types ¶
type CpuStats ¶
type CpuStats struct {
// contains filtered or unexported fields
}
CpuStats calculates cpu usage percentage
func (*CpuStats) Percent ¶
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 ¶
TicksConsumed calculates the total ticks consumes by the process across all cpu cores