metrics

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// DefaultAvxThreshold is the cutoff below which a cgroup/container is not an AVX user.
	DefaultAvxThreshold = float64(0.1)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Metrics implements collecting, caching and processing of raw metrics.

func NewMetrics

func NewMetrics(opts Options) (*Metrics, error)

NewMetrics creates a new instance for metrics collecting and processing.

func (*Metrics) Gather

func (m *Metrics) Gather() ([]*model.MetricFamily, error)

Gather is our prometheus.Gatherer interface for proxying metrics.

func (*Metrics) Start

func (m *Metrics) Start() error

Start starts metrics collection and processing.

func (*Metrics) Stop

func (m *Metrics) Stop()

Stop stops metrics collection and processing.

type Options

type Options struct {
	// PollInterval is the interval for polling raw metrics.
	PollInterval time.Duration
	// Events is the channel for delivering metrics events.
	Events chan interface{}
	// AvxThreshold is the threshold (0 - 1) for a cgroup to be considered AVX512-active
	AvxThreshold float64
}

Options describes options for metrics collection and processing.

Jump to

Keyboard shortcuts

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