metric

package
v0.5.34 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2025 License: Apache-2.0 Imports: 12 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func GetCPUPlatform added in v0.5.33

func GetCPUPlatform(cpuCode string) (string, error)

func GetPlatformCCDCount added in v0.5.33

func GetPlatformCCDCount(platform string) int

func GetPlatformSocketBandwidth added in v0.5.33

func GetPlatformSocketBandwidth(platform string) uint64

func MetricTagValueFormat added in v0.5.18

func MetricTagValueFormat(tagValue interface{}) string

MetricTagValueFormat formats the given tag value to a string that is suitable for metric tagging

Types

type Aggregator added in v0.2.0

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

	MaxTagLength = 255
)

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 metric data. Including: 1. raw data collected from agent.MetricsFetcher. 2. data calculated based on raw data.

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 int, 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) GetByStringIndex added in v0.5.16

func (c *MetricStore) GetByStringIndex(metricName string) interface{}

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 string, numaNode int, 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 string, numaID int, metricName string) (MetricData, error)

func (*MetricStore) GetContainerNumaMetrics added in v0.5.12

func (c *MetricStore) GetContainerNumaMetrics(podUID, containerName, metricName string) (map[int]MetricData, error)

func (*MetricStore) GetDeviceMetric

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

func (*MetricStore) GetNetworkMetric added in v0.4.1

func (c *MetricStore) GetNetworkMetric(networkName 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) GetPodVolumeMetric added in v0.4.0

func (c *MetricStore) GetPodVolumeMetric(podUID, volumeName, metricName string) (MetricData, error)

func (*MetricStore) SetByStringIndex added in v0.5.16

func (c *MetricStore) SetByStringIndex(metricName string, metricMap interface{})

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 string, numaNode int, 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 string, numaID int, metricName string, data MetricData)

func (*MetricStore) SetDeviceMetric

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

func (*MetricStore) SetNetworkMetric added in v0.4.1

func (c *MetricStore) SetNetworkMetric(networkName 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)

func (*MetricStore) SetPodVolumeMetric added in v0.4.0

func (c *MetricStore) SetPodVolumeMetric(podUID, volumeName, metricName string, data MetricData)

Jump to

Keyboard shortcuts

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