powermanagementhelper

package
v0.0.0-...-1f0e0a3 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCPUGovernorsAndResumeLatency

func CheckCPUGovernorsAndResumeLatency(cpus []int, nodeName, pmQos, governor string) error

CheckCPUGovernorsAndResumeLatency Checks power and latency settings of the cpus.

func CollectPowerMetricsWithNoWorkload

func CollectPowerMetricsWithNoWorkload(duration, samplingInterval time.Duration,
	tag, nodeName string) (map[string]string, error)

CollectPowerMetricsWithNoWorkload collects metrics with no workload.

func CollectPowerUsageMetrics

func CollectPowerUsageMetrics(duration, samplingInterval time.Duration, scenario,
	tag, nodeName string) (map[string]string, error)

CollectPowerUsageMetrics collects power usage metrics.

func DefineQoSTestPod

func DefineQoSTestPod(namespace namespace.Builder, nodeName, cpuReq, cpuLimit, memReq, memLimit string) *pod.Builder

DefineQoSTestPod defines test pod with given cpu and memory resources.

func DeployProcessExporter

func DeployProcessExporter() *daemonset.Builder

DeployProcessExporter deploys process exporter and returns the daemonset and error if any.

func GetComponentName

func GetComponentName(profileName string, prefix string) string

GetComponentName returns the component name for the specific performance profile.

func GetEnv

func GetEnv(key, fallback string) string

GetEnv retrieves the value of the environment variable named by the key.

func GetHostPowerUsage

func GetHostPowerUsage(nodeName string) (map[string]float64, error)

GetHostPowerUsage retrieve host power utilization metrics queried via ipmitool command.

func GetPerformanceProfileWithCPUSet

func GetPerformanceProfileWithCPUSet() (*nto.Builder, error)

GetPerformanceProfileWithCPUSet returns the first performance profile found with reserved and isolated cpuset.

func GetPowerState

func GetPowerState(perfProfile *nto.Builder) (powerState string, err error)

GetPowerState determines the power state from the workloadHints object of the PerformanceProfile.

func IsIpmitoolExist

func IsIpmitoolExist(nodeName string) bool

IsIpmitoolExist returns true if ipmitool is installed on test executor, otherwise false.

func IsSingleNodeCluster

func IsSingleNodeCluster(client *clients.Settings) bool

IsSingleNodeCluster returns true if the cluster is single-node, otherwise false.

func Max

func Max(input []float64) (max float64, err error)

Max returns the maximum value of the input array.

func Mean

func Mean(input []float64) (mean float64, err error)

Mean computes the mean value of the input array.

func Median

func Median(input []float64) (median float64, err error)

Median computes the median value of the input array.

func Min

func Min(input []float64) (min float64, err error)

Min returns the minimum value of the input array.

func ParseBmcInfo

func ParseBmcInfo(conf *config.GeneralConfig) (bmcUser, bmcPassword string, bmcHosts []string)

ParseBmcInfo returns bmc username, password, and hosts from environment variables if exist.

func RedefineContainerResources

func RedefineContainerResources(
	pod *pod.Builder, cpuRequest string, cpuLimit string, memoryRequest string, memoryLimit string) *pod.Builder

RedefineContainerResources redefines a pod builder with CPU and Memory resources in first container Use empty string to skip a resource. e.g., cpuLimit="".

func SetPowerMode

func SetPowerMode(perfProfile *nto.Builder, perPodPowerManagement, highPowerConsumption, realTime bool) error

SetPowerMode updates the performance profile with the given workload hints, and waits for the mcp update.

func StdDev

func StdDev(input []float64) (stdev float64, err error)

StdDev computes the population standard deviation of the input array.

Types

type Config

type Config struct {
	General struct {
		ReportDirAbsPath              string `yaml:"report" envconfig:"REPORT_DIR_NAME"`
		CnfNodeLabel                  string `yaml:"cnf_worker_label" envconfig:"ROLE_WORKER_CNF"`
		DumpFailedTestsReportLocation string `envconfig:"REPORTER_ERROR_OUTPUT"`
		PolarionReport                bool   `yaml:"polarion_report" envconfig:"POLARION_REPORT"`
	} `yaml:"general"`
	Network struct {
		TestContainerImage      string `yaml:"test_container_image" envconfig:"NETWORK_TEST_CONTAINER_IMAGE"`
		SriovInterfaces         string `envconfig:"CNF_INTERFACES_LIST"`
		MetalLBAddressPoolIP    string `envconfig:"METALLB_ADDR_LIST"`
		MetalLBSwitchInterfaces string `envconfig:"METALLB_SWITCH_INTERFACES"`
		MetalLBVlanIDs          string `envconfig:"METALLB_VLANS"`
		FrrImage                string `yaml:"frr_image" envconfig:"FRR_IMAGE"`
		SwitchUser              string `envconfig:"SWITCH_USER"`
		SwitchPass              string `envconfig:"SWITCH_PASS"`
		SwitchIP                string `envconfig:"SWITCH_IP"`
		SwitchInterfaces        string `envconfig:"SWITCH_INTERFACES"`
	} `yaml:"network"`
	Ran struct {
		CnfTestImage              string   `yaml:"cnf_test_image" envconfig:"CNF_TEST_IMAGE"`
		StressngTestImage         string   `yaml:"stressng_test_image" envconfig:"STRESSNG_TEST_IMAGE"`
		OslatTestImage            string   `yaml:"oslat_test_image" envconfig:"OSLAT_TEST_IMAGE"`
		ProcessExporterImage      string   `yaml:"process_exporter_image" envconfig:"PROCESS_EXPORTER_IMAGE"`
		ProcessExporterConfigsDir string   `yaml:"process_exporter_resources"`
		BmcHosts                  string   `envconfig:"BMC_HOSTS"`
		BmcUser                   string   `yaml:"bmc_user" envconfig:"BMC_USER"`
		BmcPassword               string   `yaml:"bmc_password" envconfig:"BMC_PASSWORD"`
		PduAddr                   string   `envconfig:"PDU_ADDR"`
		PduSocket                 string   `envconfig:"PDU_SOCKET"`
		RanEventTestDebug         string   `envconfig:"RAN_EVENT_TEST_DEBUG"`
		ConsumerImage             string   `yaml:"consumer_image" envconfig:"CLOUD_EVENT_CONSUMER_IMAGE"`
		BmerTestDebug             string   `envconfig:"BMER_TEST_DEBUG"`
		BmerConfigsDir            string   `yaml:"bmer_consumer_manifests"`
		PtpConfigsDir             string   `yaml:"ptp_consumer_manifests"`
		KubeconfigHub             string   `envconfig:"KUBECONFIG_HUB"`
		OcpUpgradeUpstreamURL     string   `yaml:"ocp_upgrade_upstream_url" envconfig:"OCP_UPGRADE_UPSTREAM_URL"`
		TalmPrecachePolicies      []string `envconfig:"TALM_PRECACHE_POLICIES" yaml:"talm_precache_policies"`
		KubeconfigSpoke2          string   `envconfig:"KUBECONFIG_SPOKE2"`
		ZtpGitRepo                string   `envconfig:"ZTP_GIT_REPO"`
		ZtpGitBranch              string   `envconfig:"ZTP_GIT_BRANCH"`
		ZtpGitDir                 string   `envconfig:"ZTP_GIT_DIR"`
	} `yaml:"ran"`
}

Config type keeps general configuration.

Jump to

Keyboard shortcuts

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