Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CPUUtilization ¶
CPUUtilization stores the utilization percents [0-1] for the different cpu states
type CPUUtilizationCalculator ¶
type CPUUtilizationCalculator struct {
// contains filtered or unexported fields
}
CPUUtilizationCalculator calculates the cpu utilization percents for the different cpu states It requires 2 []cpu.TimesStat and spend time to be able to calculate the difference
func (*CPUUtilizationCalculator) CalculateAndRecord ¶
func (c *CPUUtilizationCalculator) CalculateAndRecord(now pcommon.Timestamp, logicalCores int, currentCPUStats *cpu.TimesStat, recorder func(pcommon.Timestamp, CPUUtilization)) error
CalculateAndRecord calculates the cpu utilization for the different cpu states comparing previously stored []cpu.TimesStat and time.Time and current []cpu.TimesStat and current time.Time If no previous data is stored it will return empty slice of CPUUtilization and no error
Click to show internal directories.
Click to hide internal directories.