metric

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: Apache-2.0 Imports: 6 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultContainerMetricFilter = func(_ *v1.Pod, _ *v1.Container) bool { return true }

Functions

This section is empty.

Types

type Aggregator added in v0.2.0

type Aggregator string
const (
	AggregatorSum Aggregator = "sum"
	AggregatorAvg Aggregator = "avg"
)

type ContainerMetricFilter added in v0.2.0

type ContainerMetricFilter func(pod *v1.Pod, container *v1.Container) bool

ContainerMetricFilter is used to filter out unnecessary metrics if this function returns false

type MetricStore

type MetricStore struct {
	// contains filtered or unexported fields
}

MetricStore stores those raw metric data items collected from agent.MetricsFetcher

func GetMetricStoreInstance

func GetMetricStoreInstance() *MetricStore

GetMetricStoreInstance is defined as a singleton function to make sure only one metric instance is initialized

func (*MetricStore) AggregateCoreMetric added in v0.2.0

func (c *MetricStore) AggregateCoreMetric(cpuset machine.CPUSet, metricName string, agg Aggregator) float64

AggregateCoreMetric handles metric for all cores

func (*MetricStore) AggregatePodMetric added in v0.2.0

func (c *MetricStore) AggregatePodMetric(podList []*v1.Pod, metricName string, agg Aggregator, filter ContainerMetricFilter) float64

AggregatePodMetric handles metric for all pods

func (*MetricStore) AggregatePodNumaMetric added in v0.2.0

func (c *MetricStore) AggregatePodNumaMetric(podList []*v1.Pod, numa, metricName string, agg Aggregator, filter ContainerMetricFilter) float64

AggregatePodNumaMetric handles numa-level metric for all pods

func (*MetricStore) GCPodsMetric

func (c *MetricStore) GCPodsMetric(livingPodUIDSet map[string]bool)

func (*MetricStore) GetCPUMetric

func (c *MetricStore) GetCPUMetric(coreID int, metricName string) (float64, error)

func (*MetricStore) GetContainerMetric

func (c *MetricStore) GetContainerMetric(podUID, containerName, metricName string) (float64, error)

func (*MetricStore) GetContainerNumaMetric

func (c *MetricStore) GetContainerNumaMetric(podUID, containerName, numaNode, metricName string) (float64, error)

func (*MetricStore) GetDeviceMetric

func (c *MetricStore) GetDeviceMetric(deviceName string, metricName string) (float64, error)

func (*MetricStore) GetNodeMetric

func (c *MetricStore) GetNodeMetric(metricName string) (float64, error)

func (*MetricStore) GetNumaMetric

func (c *MetricStore) GetNumaMetric(numaID int, metricName string) (float64, error)

func (*MetricStore) SetCPUMetric

func (c *MetricStore) SetCPUMetric(cpuID int, metricName string, value float64)

func (*MetricStore) SetContainerMetric

func (c *MetricStore) SetContainerMetric(podUID, containerName, metricName string, value float64)

func (*MetricStore) SetContainerNumaMetric

func (c *MetricStore) SetContainerNumaMetric(podUID, containerName, numaNode, metricName string, value float64)

func (*MetricStore) SetDeviceMetric

func (c *MetricStore) SetDeviceMetric(deviceName string, metricName string, value float64)

func (*MetricStore) SetNodeMetric

func (c *MetricStore) SetNodeMetric(metricName string, value float64)

func (*MetricStore) SetNumaMetric

func (c *MetricStore) SetNumaMetric(numaID int, metricName string, value float64)

Jump to

Keyboard shortcuts

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