collector

package
v0.0.0-...-7219249 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoData = errors.New("collector returned no data")

ErrNoData indicates the collector found no data to collect, but had no other error.

Functions

func IsNoDataError

func IsNoDataError(err error) bool

func ParseCollectorMetrics

func ParseCollectorMetrics() bool

Types

type Collector

type Collector interface {
	// Get new metrics and expose them via prometheus registry.
	Update(ch chan<- prometheus.Metric) error
}

Collector is the interface a collector has to implement.

func NewClassCollector

func NewClassCollector(logger log.Logger, interval time.Duration) (Collector, error)

NewClassCollector returns a new Collector exposing class level memory bandwidth metrics.

func NewContainerCollector

func NewContainerCollector(logger log.Logger, interval time.Duration) (Collector, error)

NewContainerCollector returns a new Collector exposing container level memory bandwidth metrics.

func NewNodeCollector

func NewNodeCollector(logger log.Logger, interval time.Duration) (Collector, error)

NewNodeCollector returns a new Collector exposing node level memory bandwidth metrics.

type MBCollector

type MBCollector struct {
	Collectors map[string]Collector
	// contains filtered or unexported fields
}

Collector implements the prometheus.Collector interface.

func NewCollector

func NewCollector(logger log.Logger, interval time.Duration, filters ...string) (*MBCollector, error)

NewCollector creates a new Collector.

func (MBCollector) Collect

func (n MBCollector) Collect(ch chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface.

func (MBCollector) Describe

func (n MBCollector) Describe(ch chan<- *prometheus.Desc)

Describe implements the prometheus.Collector interface.

type ProcessedCacheStats

type ProcessedCacheStats struct {
	// The 'llc_occupancy' to MiB
	LLCOccupancy float64
}

type ProcessedMemoryBandwidthStats

type ProcessedMemoryBandwidthStats struct {
	// The 'mbm_total_bytes' to MBps
	TotalMBps float64
	// The 'mbm_local_bytes'. to MBps
	LocalMBps float64
}

type ProcessedStats

type ProcessedStats struct {
	SumMemoryBandwidth ProcessedMemoryBandwidthStats
	SumCache           ProcessedCacheStats
	MemoryBandwidth    map[string]ProcessedMemoryBandwidthStats
	Cache              map[string]ProcessedCacheStats
	CPUUtilization     float64 // cpu nums, not %
	Memory             float64 // MiB
	// contains filtered or unexported fields
}

type RawCPUStats

type RawCPUStats struct {
	CPU       int64 // microseconds
	TimeStamp string
}

type RawCacheStats

type RawCacheStats struct {
	// The 'llc_occupancy'
	LLCOccupancy uint64
}

type RawMemoryBandwidthStats

type RawMemoryBandwidthStats struct {
	// The 'mbm_total_bytes'
	TotalBytes          uint64
	TotalBytesTimeStamp string
	// The 'mbm_local_bytes'.
	LocalBytes          uint64
	LocalBytesTimeStamp string
}

MemoryBandwidthStats corresponds to MBM (Memory Bandwidth Monitoring).

type RawStats

type RawStats struct {
	SocketNum       int
	MemoryBandwidth map[string]RawMemoryBandwidthStats
	Cache           map[string]RawCacheStats
	CPUUtilization  *RawCPUStats
	Memory          int64 // bytes
}

Jump to

Keyboard shortcuts

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