metrics

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultExpireTime = 5 * time.Minute
	DefaultGCInterval = 1 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GCCounterVec

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

func NewGCCounterVec

func NewGCCounterVec(name string, vec *prometheus.CounterVec) *GCCounterVec

func (*GCCounterVec) GetCounterVec

func (g *GCCounterVec) GetCounterVec() *prometheus.CounterVec

func (*GCCounterVec) WithInc

func (g *GCCounterVec) WithInc(labels prometheus.Labels)

type GCGaugeVec

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

func NewGCGaugeVec

func NewGCGaugeVec(name string, vec *prometheus.GaugeVec) *GCGaugeVec

func (*GCGaugeVec) GetGaugeVec

func (g *GCGaugeVec) GetGaugeVec() *prometheus.GaugeVec

func (*GCGaugeVec) WithSet

func (g *GCGaugeVec) WithSet(labels prometheus.Labels, value float64)

type MetricGC

type MetricGC interface {
	Run()
	Stop()
	AddMetric(name string, metric *prometheus.MetricVec)
	UpdateStatus(name string, labels prometheus.Labels)
}

func NewMetricGC

func NewMetricGC(expireTime time.Duration, interval time.Duration) MetricGC

type MetricVecGC

type MetricVecGC interface {
	// Len returns the length of the alive metric statuses.
	Len() int
	// UpdateStatus updates the metric status with the given label values and timestamp (Unix seconds).
	UpdateStatus(updateTime int64, labels prometheus.Labels)
	// ExpireMetrics expires all metric statuses which are updated before the expired time (Unix seconds).
	ExpireMetrics(expireTime int64) int
}

func NewMetricVecGC

func NewMetricVecGC(name string, metricVec *prometheus.MetricVec) MetricVecGC

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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