metricscache

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sink

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

Sink is a temporary sink that caches metrics until a real sink is set in SetSink. it implements the metrics.MetricSink interface

func NewSink

func NewSink() *Sink

NewSink returns a pointer to a sink with empty cache

func (*Sink) AddSample

func (s *Sink) AddSample(key []string, val float32)

AddSample defaults to AddSampleWithLabels

func (*Sink) AddSampleWithLabels

func (s *Sink) AddSampleWithLabels(key []string, val float32, labels []metrics.Label)

AddSampleWithLabels sends metrics to the real sink otherwise caches them

func (*Sink) EmitKey

func (s *Sink) EmitKey(key []string, val float32)

EmitKey sends metrics to the real sink otherwise caches them

func (*Sink) IncrCounter

func (s *Sink) IncrCounter(key []string, val float32)

IncrCounter defaults to IncrCounterWithLabels

func (*Sink) IncrCounterWithLabels

func (s *Sink) IncrCounterWithLabels(key []string, val float32, labels []metrics.Label)

IncrCounterWithLabels sends metrics to the real sink otherwise caches them

func (*Sink) SetGauge

func (s *Sink) SetGauge(key []string, val float32)

SetGauge defaults to SetGaugeWithLabels

func (*Sink) SetGaugeWithLabels

func (s *Sink) SetGaugeWithLabels(key []string, val float32, labels []metrics.Label)

SetGaugeWithLabels sends metrics to the real sink otherwise caches them

func (*Sink) SetSink

func (s *Sink) SetSink(newSink metrics.MetricSink)

SetSink takes a sink and will ensure that the sink sets the value and then starts forwarding metrics on to the realSink once called. It will also replay all the cached metrics and send them to the realSink

Jump to

Keyboard shortcuts

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