local

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateContainerEnergyByRatioPowerModel

func UpdateContainerEnergyByRatioPowerModel(containersMetrics map[string]*collector_metric.ContainerMetrics, nodeMetrics *collector_metric.NodeMetrics)

UpdateContainerEnergyByRatioPowerModel calculates the container energy consumption based on the resource utilization ratio

func UpdateProcessEnergyByRatioPowerModel

func UpdateProcessEnergyByRatioPowerModel(processMetrics map[uint64]*collector_metric.ProcessMetrics, containerMetrics *collector_metric.ContainerMetrics)

UpdateProcessEnergyByRatioPowerModel calculates the process energy consumption based on the energy consumption of the container that contains all the processes

Types

type AllWeights

type AllWeights struct {
	BiasWeight           float64                                  `json:"Bias_Weight"`
	CategoricalVariables map[string]map[string]CategoricalFeature `json:"Categorical_Variables"`
	NumericalVariables   map[string]NormalizedNumericalFeature    `json:"Numerical_Variables"`
}

type CategoricalFeature

type CategoricalFeature struct {
	Weight float64 `json:"weight"`
}

type ComponentModelWeights

type ComponentModelWeights map[string]ModelWeights

ComponentModelWeights defines structure for multiple (power component's) weights { "core":

{"All_Weights":
  {
  "Bias_Weight": 1.0,
  "Categorical_Variables": {"cpu_architecture": {"Sky Lake": {"weight": 1.0}}},
  "Numerical_Variables": {"cpu_cycles": {"mean": 0, "variance": 1.0, "weight": 1.0}}
  }
},

"dram": {"All_Weights":

  {
  "Bias_Weight": 1.0,
  "Categorical_Variables": {"cpu_architecture": {"Sky Lake": {"weight": 1.0}}},
  "Numerical_Variables": {"cache_miss": {"mean": 0, "variance": 1.0, "weight": 1.0}}
  }
}

type LinearRegressor

type LinearRegressor struct {
	Endpoint       string
	UsageMetrics   []string
	OutputType     types.ModelOutputType
	SystemFeatures []string
	ModelName      string
	SelectFilter   string
	InitModelURL   string
	// contains filtered or unexported fields
}

LinearRegressor defines power estimator with linear regression approach

func (*LinearRegressor) GetComponentPower

func (r *LinearRegressor) GetComponentPower(usageValues [][]float64, systemValues []string) (map[string][]float64, error)

GetComponentPower applies each component's ModelWeight prediction and return a map of component powers

func (*LinearRegressor) GetTotalPower

func (r *LinearRegressor) GetTotalPower(usageValues [][]float64, systemValues []string) ([]float64, error)

GetTotalPower applies ModelWeight prediction and return a list of total powers

func (*LinearRegressor) Init

func (r *LinearRegressor) Init() bool

Init returns valid if model weight is obtainable

type ModelRequest

type ModelRequest struct {
	ModelName    string   `json:"model_name"`
	MetricNames  []string `json:"metrics"`
	SelectFilter string   `json:"filter"`
	OutputType   string   `json:"output_type"`
}

ModelRequest defines a request to Kepler Model Server to get model weights

type ModelWeights

type ModelWeights struct {
	AllWeights `json:"All_Weights"`
}

ModelWeights, AllWeight, CategoricalFeature, NormalizedNumericalFeature define structure of model weight { "All_Weights":

	{
	"Bias_Weight": 1.0,
	"Categorical_Variables": {"cpu_architecture": {"Sky Lake": {"weight": 1.0}}},
	"Numerical_Variables": {"cpu_cycles": {"mean": 0, "variance": 1.0, "weight": 1.0}}
	}
}

type NormalizedNumericalFeature

type NormalizedNumericalFeature struct {
	Mean     float64 `json:"mean"`
	Variance float64 `json:"variance"`
	Weight   float64 `json:"weight"`
}

Jump to

Keyboard shortcuts

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