metric

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 9 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 MetricData added in v0.3.0

type MetricData struct {
	Value float64

	// Time may have different meanings in different scenarios
	// - for single metric: it represents the exact collecting time
	// - for aggregated metric: it represents the newest time among all metric items
	Time *time.Time
}

MetricData represents the standard response data for metric getter functions

type MetricStore

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

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

func NewMetricStore added in v0.3.0

func NewMetricStore() *MetricStore

func (*MetricStore) AggregateCoreMetric added in v0.2.0

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

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) MetricData

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) MetricData

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) (MetricData, error)

func (*MetricStore) GetCgroupMetric added in v0.3.0

func (c *MetricStore) GetCgroupMetric(cgroupPath, metricName string) (MetricData, error)

func (*MetricStore) GetCgroupNumaMetric added in v0.3.0

func (c *MetricStore) GetCgroupNumaMetric(cgroupPath, numaNode, metricName string) (MetricData, error)

func (*MetricStore) GetContainerMetric

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

func (*MetricStore) GetContainerNumaMetric

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

func (*MetricStore) GetDeviceMetric

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

func (*MetricStore) GetNodeMetric

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

func (*MetricStore) GetNumaMetric

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

func (*MetricStore) SetCPUMetric

func (c *MetricStore) SetCPUMetric(cpuID int, metricName string, data MetricData)

func (*MetricStore) SetCgroupMetric added in v0.3.0

func (c *MetricStore) SetCgroupMetric(cgroupPath, metricName string, data MetricData)

func (*MetricStore) SetCgroupNumaMetric added in v0.3.0

func (c *MetricStore) SetCgroupNumaMetric(cgroupPath, numaNode, metricName string, data MetricData)

func (*MetricStore) SetContainerMetric

func (c *MetricStore) SetContainerMetric(podUID, containerName, metricName string, data MetricData)

func (*MetricStore) SetContainerNumaMetric

func (c *MetricStore) SetContainerNumaMetric(podUID, containerName, numaNode, metricName string, data MetricData)

func (*MetricStore) SetDeviceMetric

func (c *MetricStore) SetDeviceMetric(deviceName string, metricName string, data MetricData)

func (*MetricStore) SetNodeMetric

func (c *MetricStore) SetNodeMetric(metricName string, data MetricData)

func (*MetricStore) SetNumaMetric

func (c *MetricStore) SetNumaMetric(numaID int, metricName string, data MetricData)

Jump to

Keyboard shortcuts

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