ucal

package
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUUtilization

type CPUUtilization struct {
	User   float64
	System float64
	Iowait float64
}

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

Jump to

Keyboard shortcuts

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