model

package
v0.7.10 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EstimatorSidecarSocket = "/tmp/estimator.sock"
)

Functions

func CreateNodeComponentPoweEstimatorModel added in v0.5.4

func CreateNodeComponentPoweEstimatorModel(nodeFeatureNames, systemMetaDataFeatureNames, systemMetaDataFeatureValues []string)

CreateNodeComponentPoweEstimatorModel only create a new power model estimater if node components power metrics are not available

func CreateNodePlatformPoweEstimatorModel added in v0.5.4

func CreateNodePlatformPoweEstimatorModel(nodeFeatureNames, systemMetaDataFeatureNames, systemMetaDataFeatureValues []string)

CreateNodeComponentPoweEstimatorModel only create a new power model estimater if node platform power metrics are not available

func CreatePowerEstimatorModels added in v0.5.4

func CreatePowerEstimatorModels(processFeatureNames, systemMetaDataFeatureNames, systemMetaDataFeatureValues []string, hardwareCountersEnabled bool)

CreatePowerEstimatorModels checks validity of power model and set estimate functions

func CreatePowerModelConfig added in v0.5.4

func CreatePowerModelConfig(powerSourceTarget string) *types.ModelConfig

CreatePowerModelConfig loads the power model configurations from the ConfigMap, including the Model type, name, filter, URL to download data, and model output type. The powerSourceTarget parameter acts as a prefix, which can have values like NODE_TOTAL, NODE_COMPONENTS, CONTAINER_COMPONENTS, etc. The complete variable name is created by combining the prefix with the specific attribute. For example, if the model name (which the key is MODEL) is under NODE_TOTAL, it will be called NODE_TOTAL_MODEL.

func CreateProcessPowerEstimatorModel added in v0.5.4

func CreateProcessPowerEstimatorModel(processFeatureNames, systemMetaDataFeatureNames, systemMetaDataFeatureValues []string, hardwareCountersEnabled bool)

func GetNodeComponentPowers

func GetNodeComponentPowers(nodeMetrics *stats.NodeStats, isIdlePower bool) (nodeComponentsEnergy map[int]source.NodeComponentsEnergy)

GetNodeComponentPowers returns estimated RAPL power for the node

func GetNodePlatformPower added in v0.5.4

func GetNodePlatformPower(nodeMetrics *stats.NodeStats, isIdlePower bool) (platformEnergy map[string]float64)

GetNodePlatformPower returns a single estimated value of node total power

func IsNodeComponentPowerModelEnabled

func IsNodeComponentPowerModelEnabled() bool

IsNodeComponentPowerModelEnabled returns if the estimator has been enabled or not

func IsNodePlatformPowerModelEnabled

func IsNodePlatformPowerModelEnabled() bool

IsNodePlatformPowerModelEnabled returns if the estimator has been enabled or not

func UpdateNodeComponentEnergy added in v0.5.4

func UpdateNodeComponentEnergy(nodeMetrics *stats.NodeStats)

UpdateNodeComponentIdleEnergy sets the power model samples, get absolute powers, and set gauge value for each component energy

func UpdateNodeComponentIdleEnergy added in v0.6.1

func UpdateNodeComponentIdleEnergy(nodeMetrics *stats.NodeStats)

UpdateNodeComponentIdleEnergy sets the power model samples to zeros, get idle powers, and set gauge value for each component idle energy

func UpdateNodePlatformEnergy added in v0.5.4

func UpdateNodePlatformEnergy(nodeMetrics *stats.NodeStats)

UpdateNodePlatformEnergy sets the power model samples, get absolute powers, and set platform energy

func UpdateNodePlatformIdleEnergy added in v0.6.1

func UpdateNodePlatformIdleEnergy(nodeMetrics *stats.NodeStats)

UpdateNodePlatformIdleEnergy sets the power model samples to zeros, get idle powers, and set platform energy

func UpdateProcessEnergy

func UpdateProcessEnergy(processesMetrics map[uint64]*stats.ProcessStats, nodeMetrics *stats.NodeStats)

UpdateProcessEnergy resets the power model samples, add new samples to the power models, then estimates the idle and dynamic energy

Types

type PowerModelInterface added in v0.7.4

type PowerModelInterface interface {
	// AddProcessFeatureValues adds the new x as a point for training or prediction. Where x are explanatory variable (or the independent variable).
	// x values are added to a sliding window with circular list for dynamic data flow
	AddProcessFeatureValues(x []float64)
	// AddNodeFeatureValues adds the new x as a point for training or prediction. Where x are explanatory variable (or the independent variable).
	AddNodeFeatureValues(x []float64)
	// AddDesiredOutValue adds the new y as a point for training. Where y the response variable (or the dependent variable).
	AddDesiredOutValue(y float64)
	// ResetSampleIdx set the sample sliding window index, setting to 0 to overwrite the old samples with new ones for training or prediction.
	ResetSampleIdx()
	// Train triggers the regression fit after adding data points to create a new power model
	Train() error
	// IsEnabled returns true if the power model was trained and is active
	IsEnabled() bool
	// GetModelType returns if the model is Ratio, Regressor or EstimatorSidecar
	GetModelType() types.ModelType
	// GetProcessFeatureNamesList returns the list of process features that the model was configured to use
	GetProcessFeatureNamesList() []string
	// GetNodeFeatureNamesList returns the list of node features that the model was configured to use
	GetNodeFeatureNamesList() []string
	// GetPlatformPower returns the total Platform Power in Watts associated to each process/process/pod
	// If isIdlePower is true, return the idle power, otherwise return the dynamic or absolute power depending on the model.
	GetPlatformPower(isIdlePower bool) ([]float64, error)
	// GetComponentsPower returns RAPL components Power in Watts associated to each each process/process/pod
	// If isIdlePower is true, return the idle power, otherwise return the dynamic or absolute power depending on the model.
	GetComponentsPower(isIdlePower bool) ([]source.NodeComponentsEnergy, error)
	// GetComponentsPower returns GPU Power in Watts associated to each each process/process/pod
	// If isIdlePower is true, return the idle power, otherwise return the dynamic or absolute power depending on the model.
	GetGPUPower(isIdlePower bool) ([]float64, error)
}

PowerModelInterface defines the power model skeleton

var (
	ProcessPlatformPowerModel  PowerModelInterface
	ProcessComponentPowerModel PowerModelInterface
)
var (
	// the absulute power model includes both the absolute and idle power consumption
	NodeComponentPowerModel PowerModelInterface
)
var (
	NodePlatformPowerModel PowerModelInterface
)

Directories

Path Synopsis
estimator

Jump to

Keyboard shortcuts

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