Documentation ¶
Index ¶
- type FakeMetricsFetcher
- func (f *FakeMetricsFetcher) AggregateCoreMetric(cpuset machine.CPUSet, metricName string, agg metric.Aggregator) metric.MetricData
- func (f *FakeMetricsFetcher) AggregatePodMetric(podList []*v1.Pod, metricName string, agg metric.Aggregator, ...) metric.MetricData
- func (f *FakeMetricsFetcher) AggregatePodNumaMetric(podList []*v1.Pod, numaNode, metricName string, agg metric.Aggregator, ...) metric.MetricData
- func (f *FakeMetricsFetcher) DeRegisterNotifier(scope MetricsScope, key string)
- func (f *FakeMetricsFetcher) GetCPUMetric(coreID int, metricName string) (metric.MetricData, error)
- func (f *FakeMetricsFetcher) GetCgroupMetric(cgroupPath, metricName string) (metric.MetricData, error)
- func (f *FakeMetricsFetcher) GetCgroupNumaMetric(cgroupPath, numaNode, metricName string) (metric.MetricData, error)
- func (f *FakeMetricsFetcher) GetContainerMetric(podUID, containerName, metricName string) (metric.MetricData, error)
- func (f *FakeMetricsFetcher) GetContainerNumaMetric(podUID, containerName, numaNode, metricName string) (metric.MetricData, error)
- func (f *FakeMetricsFetcher) GetDeviceMetric(deviceName string, metricName string) (metric.MetricData, error)
- func (f *FakeMetricsFetcher) GetNodeMetric(metricName string) (metric.MetricData, error)
- func (f *FakeMetricsFetcher) GetNumaMetric(numaID int, metricName string) (metric.MetricData, error)
- func (f *FakeMetricsFetcher) RegisterExternalMetric(fu func(store *metric.MetricStore))
- func (f *FakeMetricsFetcher) RegisterNotifier(scope MetricsScope, req NotifiedRequest, response chan NotifiedResponse) string
- func (f *FakeMetricsFetcher) Run(ctx context.Context)
- func (f *FakeMetricsFetcher) SetCPUMetric(cpu int, metricName string, data metric.MetricData)
- func (f *FakeMetricsFetcher) SetCgroupMetric(cgroupPath, metricName string, data metric.MetricData)
- func (f *FakeMetricsFetcher) SetCgroupNumaMetric(cgroupPath, numaNode, metricName string, data metric.MetricData)
- func (f *FakeMetricsFetcher) SetContainerMetric(podUID, containerName, metricName string, data metric.MetricData)
- func (f *FakeMetricsFetcher) SetContainerNumaMetric(podUID, containerName, numaNode, metricName string, data metric.MetricData)
- func (f *FakeMetricsFetcher) SetDeviceMetric(deviceName string, metricName string, data metric.MetricData)
- func (f *FakeMetricsFetcher) SetNodeMetric(metricName string, data metric.MetricData)
- func (f *FakeMetricsFetcher) SetNumaMetric(numaID int, metricName string, data metric.MetricData)
- type MetricsFetcher
- type MetricsScope
- type NotifiedData
- type NotifiedRequest
- type NotifiedResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeMetricsFetcher ¶
func (*FakeMetricsFetcher) AggregateCoreMetric ¶ added in v0.2.0
func (f *FakeMetricsFetcher) AggregateCoreMetric(cpuset machine.CPUSet, metricName string, agg metric.Aggregator) metric.MetricData
func (*FakeMetricsFetcher) AggregatePodMetric ¶ added in v0.2.0
func (f *FakeMetricsFetcher) AggregatePodMetric(podList []*v1.Pod, metricName string, agg metric.Aggregator, filter metric.ContainerMetricFilter) metric.MetricData
func (*FakeMetricsFetcher) AggregatePodNumaMetric ¶ added in v0.2.0
func (f *FakeMetricsFetcher) AggregatePodNumaMetric(podList []*v1.Pod, numaNode, metricName string, agg metric.Aggregator, filter metric.ContainerMetricFilter) metric.MetricData
func (*FakeMetricsFetcher) DeRegisterNotifier ¶
func (f *FakeMetricsFetcher) DeRegisterNotifier(scope MetricsScope, key string)
func (*FakeMetricsFetcher) GetCPUMetric ¶
func (f *FakeMetricsFetcher) GetCPUMetric(coreID int, metricName string) (metric.MetricData, error)
func (*FakeMetricsFetcher) GetCgroupMetric ¶ added in v0.3.0
func (f *FakeMetricsFetcher) GetCgroupMetric(cgroupPath, metricName string) (metric.MetricData, error)
func (*FakeMetricsFetcher) GetCgroupNumaMetric ¶ added in v0.3.0
func (f *FakeMetricsFetcher) GetCgroupNumaMetric(cgroupPath, numaNode, metricName string) (metric.MetricData, error)
func (*FakeMetricsFetcher) GetContainerMetric ¶
func (f *FakeMetricsFetcher) GetContainerMetric(podUID, containerName, metricName string) (metric.MetricData, error)
func (*FakeMetricsFetcher) GetContainerNumaMetric ¶
func (f *FakeMetricsFetcher) GetContainerNumaMetric(podUID, containerName, numaNode, metricName string) (metric.MetricData, error)
func (*FakeMetricsFetcher) GetDeviceMetric ¶
func (f *FakeMetricsFetcher) GetDeviceMetric(deviceName string, metricName string) (metric.MetricData, error)
func (*FakeMetricsFetcher) GetNodeMetric ¶
func (f *FakeMetricsFetcher) GetNodeMetric(metricName string) (metric.MetricData, error)
func (*FakeMetricsFetcher) GetNumaMetric ¶
func (f *FakeMetricsFetcher) GetNumaMetric(numaID int, metricName string) (metric.MetricData, error)
func (*FakeMetricsFetcher) RegisterExternalMetric ¶ added in v0.3.0
func (f *FakeMetricsFetcher) RegisterExternalMetric(fu func(store *metric.MetricStore))
func (*FakeMetricsFetcher) RegisterNotifier ¶
func (f *FakeMetricsFetcher) RegisterNotifier(scope MetricsScope, req NotifiedRequest, response chan NotifiedResponse) string
func (*FakeMetricsFetcher) Run ¶
func (f *FakeMetricsFetcher) Run(ctx context.Context)
func (*FakeMetricsFetcher) SetCPUMetric ¶ added in v0.2.0
func (f *FakeMetricsFetcher) SetCPUMetric(cpu int, metricName string, data metric.MetricData)
func (*FakeMetricsFetcher) SetCgroupMetric ¶ added in v0.3.0
func (f *FakeMetricsFetcher) SetCgroupMetric(cgroupPath, metricName string, data metric.MetricData)
func (*FakeMetricsFetcher) SetCgroupNumaMetric ¶ added in v0.3.0
func (f *FakeMetricsFetcher) SetCgroupNumaMetric(cgroupPath, numaNode, metricName string, data metric.MetricData)
func (*FakeMetricsFetcher) SetContainerMetric ¶
func (f *FakeMetricsFetcher) SetContainerMetric(podUID, containerName, metricName string, data metric.MetricData)
func (*FakeMetricsFetcher) SetContainerNumaMetric ¶
func (f *FakeMetricsFetcher) SetContainerNumaMetric(podUID, containerName, numaNode, metricName string, data metric.MetricData)
func (*FakeMetricsFetcher) SetDeviceMetric ¶ added in v0.2.0
func (f *FakeMetricsFetcher) SetDeviceMetric(deviceName string, metricName string, data metric.MetricData)
func (*FakeMetricsFetcher) SetNodeMetric ¶
func (f *FakeMetricsFetcher) SetNodeMetric(metricName string, data metric.MetricData)
func (*FakeMetricsFetcher) SetNumaMetric ¶
func (f *FakeMetricsFetcher) SetNumaMetric(numaID int, metricName string, data metric.MetricData)
type MetricsFetcher ¶
type MetricsFetcher interface { // Run starts the preparing logic to collect node metadata. Run(ctx context.Context) // RegisterNotifier register a channel for raw metric, any time when metric // changes, send a data into this given channel along with current time, and // we will return a unique key to help with deRegister logic. // // this "current time" may not represent precisely time when this metric // is at, but it indeed is the most precise time katalyst system can provide. RegisterNotifier(scope MetricsScope, req NotifiedRequest, response chan NotifiedResponse) string DeRegisterNotifier(scope MetricsScope, key string) // RegisterExternalMetric register a function to set metric that can // only be obtained from external sources RegisterExternalMetric(f func(store *metric.MetricStore)) // GetNodeMetric get metric of node. GetNodeMetric(metricName string) (metric.MetricData, error) // GetNumaMetric get metric of numa. GetNumaMetric(numaID int, metricName string) (metric.MetricData, error) // GetDeviceMetric get metric of device. GetDeviceMetric(deviceName string, metricName string) (metric.MetricData, error) // GetCPUMetric get metric of cpu. GetCPUMetric(coreID int, metricName string) (metric.MetricData, error) // GetContainerMetric get metric of container. GetContainerMetric(podUID, containerName, metricName string) (metric.MetricData, error) // GetContainerNumaMetric get metric of container per numa. GetContainerNumaMetric(podUID, containerName, numaNode, metricName string) (metric.MetricData, error) // AggregatePodNumaMetric handles numa-level metric for all pods AggregatePodNumaMetric(podList []*v1.Pod, numaNode, metricName string, agg metric.Aggregator, filter metric.ContainerMetricFilter) metric.MetricData // AggregatePodMetric handles metric for all pods AggregatePodMetric(podList []*v1.Pod, metricName string, agg metric.Aggregator, filter metric.ContainerMetricFilter) metric.MetricData // AggregateCoreMetric handles metric for all cores AggregateCoreMetric(cpuset machine.CPUSet, metricName string, agg metric.Aggregator) metric.MetricData // GetCgroupMetric get metric of cgroup path: /kubepods/burstable, /kubepods/besteffort, etc. GetCgroupMetric(cgroupPath, metricName string) (metric.MetricData, error) // GetCgroupNumaMetric get NUMA metric of qos class: /kubepods/burstable, /kubepods/besteffort, etc. GetCgroupNumaMetric(cgroupPath, numaNode, metricName string) (metric.MetricData, error) }
MetricsFetcher is used to get Node and Pod metrics.
func NewFakeMetricsFetcher ¶
func NewFakeMetricsFetcher(emitter metrics.MetricEmitter) MetricsFetcher
NewFakeMetricsFetcher returns a fake MetricsFetcher.
type MetricsScope ¶
type MetricsScope string
const ( MetricsScopeNode MetricsScope = "node" MetricsScopeNuma MetricsScope = "numa" MetricsScopeCPU MetricsScope = "cpu" MetricsScopeDevice MetricsScope = "device" MetricsScopeContainer MetricsScope = "container" )
type NotifiedData ¶
type NotifiedData struct { Scope MetricsScope Req NotifiedRequest Response chan NotifiedResponse }
NotifiedData defines the structure as response data for notifier
type NotifiedRequest ¶
type NotifiedRequest struct { MetricName string DeviceID string NumaID int CoreID int PodUID string ContainerName string NumaNode string }
NotifiedRequest defines the structure as requests for notifier
type NotifiedResponse ¶
type NotifiedResponse struct { Req NotifiedRequest metric.MetricData }
Click to show internal directories.
Click to hide internal directories.