helper

package
v0.5.15 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContainerMetric

func GetContainerMetric(metricsFetcher types.MetricsFetcher, emitter metrics.MetricEmitter, podUID, containerName, metricName string, numaID int) (float64, error)

func GetDeviceMetric added in v0.4.1

func GetDeviceMetric(metricsFetcher types.MetricsFetcher, emitter metrics.MetricEmitter, metricName string, devName string) (float64, error)

func GetDeviceMetricWithTime added in v0.4.1

func GetDeviceMetricWithTime(metricsFetcher types.MetricsFetcher, emitter metrics.MetricEmitter, metricName string, devName string) (metricutil.MetricData, error)

func GetNodeMetric added in v0.4.0

func GetNodeMetric(metricsFetcher types.MetricsFetcher, emitter metrics.MetricEmitter, metricName string) (float64, error)

func GetNodeMetricWithTime added in v0.4.0

func GetNodeMetricWithTime(metricsFetcher types.MetricsFetcher, emitter metrics.MetricEmitter, metricName string) (metricutil.MetricData, error)

func GetNumaMetric added in v0.4.0

func GetNumaMetric(metricsFetcher types.MetricsFetcher, emitter metrics.MetricEmitter, metricName string, numaID int) (float64, error)

func GetNumaMetricWithTime added in v0.4.0

func GetNumaMetricWithTime(metricsFetcher types.MetricsFetcher, emitter metrics.MetricEmitter, metricName string, numaID int) (metricutil.MetricData, error)

func GetPodMetric

func GetPodMetric(metricsFetcher types.MetricsFetcher, emitter metrics.MetricEmitter, pod *v1.Pod, metricName string, numaID int) (float64, error)

GetPodMetric returns the value of a pod-level metric. And the value of a pod-level metric is calculated by summing the metric values for all containers in that pod.

func GetVolumeMetric added in v0.4.0

func GetVolumeMetric(metricsFetcher types.MetricsFetcher, emitter metrics.MetricEmitter, podUID, volumeName, metricName string) (float64, error)

func GetWatermarkMetrics

func GetWatermarkMetrics(metricsFetcher types.MetricsFetcher, emitter metrics.MetricEmitter, numaID int) (free, total, scaleFactor float64, err error)

GetWatermarkMetrics returns system-water mark related metrics (config) if numa node is specified, return config in this numa; otherwise return system-level config

Types

type ReclaimMetrics added in v0.5.8

type ReclaimMetrics struct {
	// total cpu usage of cpus in reclaim pool
	PoolCPUUsage float64
	// cpu usage of root cgroup for reclaim pods
	CgroupCPUUsage float64
	// reclaim pool size
	Size int
	// reclaimedCoresSupply is the actual CPU resource can be supplied to reclaimed cores
	ReclaimedCoresSupply float64
}

func GetReclaimMetrics added in v0.5.8

func GetReclaimMetrics(cpus machine.CPUSet, cgroupPath string, metricsFetcher types.MetricsFetcher) (*ReclaimMetrics, error)

GetReclaimMetrics returns the reclaim CPU metrics for the given cpus and cgroupPath

Jump to

Keyboard shortcuts

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