Documentation ¶
Index ¶
- Constants
- func CreateMockedProcessStats(numContainers int) map[uint64]*ProcessStats
- func GetProcessFeatureNames(bpfSupportedMetrics bpf.SupportedMetrics) []string
- func SetMockedCollectorMetrics()
- type ContainerStats
- type NodeStats
- func (ne *NodeStats) CPUArchitecture() string
- func (ne *NodeStats) CalcIdleEnergy(absM, idleM, resouceUtil string)
- func (ne *NodeStats) MetadataFeatureNames() []string
- func (ne *NodeStats) MetadataFeatureValues() []string
- func (ne *NodeStats) NodeName() string
- func (ne *NodeStats) ResetDeltaValues()
- func (ne *NodeStats) SetNodeOtherComponentsEnergy()
- func (ne *NodeStats) String() string
- func (ne *NodeStats) UpdateIdleEnergyWithMinValue(isComponentsSystemCollectionSupported bool)
- type ProcessStats
- type Stats
- func (s *Stats) AbsEnergyMetrics() []string
- func (s *Stats) BPFMetrics() []string
- func (s *Stats) CalcDynEnergy(absM, idleM, dynM, id string)
- func (s *Stats) DynEnergyMetrics() []string
- func (s *Stats) IdleEnergyMetrics() []string
- func (s *Stats) ResetDeltaValues()
- func (s *Stats) String() string
- func (s *Stats) ToEstimatorValues(featuresName []string, shouldNormalize bool) []float64
- func (s *Stats) UpdateDynEnergy()
- type VMStats
Constants ¶
const (
MockedSocketID = "socket0"
)
Variables ¶
This section is empty.
Functions ¶
func CreateMockedProcessStats ¶
func CreateMockedProcessStats(numContainers int) map[uint64]*ProcessStats
CreateMockedProcessStats adds two containers with all metrics initialized
func GetProcessFeatureNames ¶ added in v0.7.11
func GetProcessFeatureNames(bpfSupportedMetrics bpf.SupportedMetrics) []string
func SetMockedCollectorMetrics ¶
func SetMockedCollectorMetrics()
SetMockedCollectorMetrics adds all metric to a process, otherwise it will not create the right usageMetric with all elements. The usageMetric is used in the Prediction Power Models TODO: do not use a fixed usageMetric array in the power models, a structured data is more disarable.
Types ¶
type ContainerStats ¶
type ContainerStats struct { Stats PIDS map[uint64]bool ContainerID string ContainerName string PodName string Namespace string }
func NewContainerStats ¶
func NewContainerStats(containerName, podName, podNamespace, containerID string, bpfSupportedMetrics bpf.SupportedMetrics) *ContainerStats
NewContainerStats creates a new ContainerStats instance
func (*ContainerStats) ResetDeltaValues ¶
func (c *ContainerStats) ResetDeltaValues()
ResetCurr reset all current value to 0
func (*ContainerStats) SetLatestProcess ¶
func (c *ContainerStats) SetLatestProcess(pid uint64)
SetLatestProcess set PID to the latest captured process NOTICE: can lose main container info for multi-container pod
func (*ContainerStats) String ¶
func (c *ContainerStats) String() string
type NodeStats ¶
type NodeStats struct { Stats // IdleResUtilization is used to determine idle pmap[string]eriods IdleResUtilization map[string]uint64 // contains filtered or unexported fields }
func CreateMockedNodeStats ¶
func CreateMockedNodeStats() NodeStats
CreateMockedNodeStats creates a node metric with power consumption and add the process resource utilization
func NewNodeStats ¶
func NewNodeStats(bpfSupportedMetrics bpf.SupportedMetrics) *NodeStats
func (*NodeStats) CPUArchitecture ¶ added in v0.7.12
func (*NodeStats) CalcIdleEnergy ¶
func (*NodeStats) MetadataFeatureNames ¶ added in v0.7.12
func (*NodeStats) MetadataFeatureValues ¶ added in v0.7.12
func (*NodeStats) ResetDeltaValues ¶
func (ne *NodeStats) ResetDeltaValues()
ResetDeltaValues reset all delta values to 0
func (*NodeStats) SetNodeOtherComponentsEnergy ¶
func (ne *NodeStats) SetNodeOtherComponentsEnergy()
SetNodeOtherComponentsEnergy adds the latest energy consumption collected from the other node's components than CPU and DRAM Other components energy is a special case where the energy is calculated and not measured
func (*NodeStats) UpdateIdleEnergyWithMinValue ¶
type ProcessStats ¶
type ProcessStats struct { Stats PID uint64 CGroupID uint64 ContainerID string VMID string Command string IdleCounter int }
func NewProcessStats ¶
func NewProcessStats(pid, cGroupID uint64, containerID, vmID, command string, bpfSupportedMetrics bpf.SupportedMetrics) *ProcessStats
NewProcessStats creates a new ProcessStats instance
func (*ProcessStats) ResetDeltaValues ¶
func (p *ProcessStats) ResetDeltaValues()
ResetDeltaValues reset all delta values to 0
func (*ProcessStats) String ¶
func (p *ProcessStats) String() string
type Stats ¶
type Stats struct { ResourceUsage map[string]types.UInt64StatCollection EnergyUsage map[string]types.UInt64StatCollection // contains filtered or unexported fields }
Stats stores resource and energy usage statistics.
func NewStats ¶
func NewStats(bpfSupportedMetrics bpf.SupportedMetrics) *Stats
NewStats creates a new Stats instance
func (*Stats) AbsEnergyMetrics ¶ added in v0.7.12
func (*Stats) BPFMetrics ¶ added in v0.7.12
func (*Stats) CalcDynEnergy ¶
CalcDynEnergy calculates the difference between the absolute and idle energy/power.
func (*Stats) DynEnergyMetrics ¶ added in v0.7.12
func (*Stats) IdleEnergyMetrics ¶ added in v0.7.12
func (*Stats) ResetDeltaValues ¶
func (s *Stats) ResetDeltaValues()
ResetDeltaValues resets all current values to 0.
func (*Stats) ToEstimatorValues ¶
ToEstimatorValues returns values for the specified metric names, normalized if required. The metrics can be related to resource utilization or power consumption. Since Kepler collects metrics at intervals of SamplePeriodSec, which is greater than 1 second, and the power models are trained to estimate power in 1 second interval. It is necessary to normalize the resource utilization by the SamplePeriodSec. This is important because the power curve can be different for higher or lower resource usage within 1 second interval.
func (*Stats) UpdateDynEnergy ¶
func (s *Stats) UpdateDynEnergy()
UpdateDynEnergy calculates the dynamic energy.
type VMStats ¶
func NewVMStats ¶
func NewVMStats(pid uint64, vmID string, bpfSupportedMetrics bpf.SupportedMetrics) *VMStats
NewVMStats creates a new VMStats instance
func (*VMStats) ResetDeltaValues ¶
func (vm *VMStats) ResetDeltaValues()
ResetCurr reset all current value to 0