local

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const CollectorName = "LocalCollector"

Variables

This section is empty.

Functions

func NewLocalCollector

func NewLocalCollector(config *config.Configuration, cgroupManager cgroup.CgroupManager) framework.MetricCollect

Types

type CPUResourceCollector

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

func (*CPUResourceCollector) CollectLocalMetrics

func (c *CPUResourceCollector) CollectLocalMetrics(metricInfo *LocalMetricInfo, start time.Time, window metav1.Duration) ([]*prompb.TimeSeries, error)

func (*CPUResourceCollector) Run

func (c *CPUResourceCollector) Run()

type LocalCollector

type LocalCollector struct {
	CgroupManager          cgroup.CgroupManager
	InitiatedSubCollectors map[string]SubCollector
}

func (*LocalCollector) CollectMetrics

func (c *LocalCollector) CollectMetrics(metricInfo interface{}, start time.Time, window metav1.Duration) ([]*prompb.TimeSeries, error)

func (*LocalCollector) MetricCollectorName

func (c *LocalCollector) MetricCollectorName() string

func (*LocalCollector) Run

func (c *LocalCollector) Run() error

type LocalMetricInfo

type LocalMetricInfo struct {
	ResourceType          string
	IncludeGuaranteedPods bool
	IncludeSystemUsed     bool
}

type MemoryResourceCollector

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

func (*MemoryResourceCollector) CollectLocalMetrics

func (c *MemoryResourceCollector) CollectLocalMetrics(metricInfo *LocalMetricInfo, start time.Time, window metav1.Duration) ([]*prompb.TimeSeries, error)

func (*MemoryResourceCollector) Run

func (c *MemoryResourceCollector) Run()

type SubCollector

type SubCollector interface {
	// Run runs sub collector
	Run()
	// CollectLocalMetrics returns local metric from sub collector
	CollectLocalMetrics(metricInfo *LocalMetricInfo, start time.Time, window metav1.Duration) ([]*prompb.TimeSeries, error)
}

func NewCPUResourceCollector

func NewCPUResourceCollector(cgroupManager cgroup.CgroupManager) (SubCollector, error)

func NewMemoryResourceCollector

func NewMemoryResourceCollector(cgroupManager cgroup.CgroupManager) (SubCollector, error)

Jump to

Keyboard shortcuts

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