fakemetrics

package
v1.8.8 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeMetrics

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

func New

func New() *FakeMetrics

func (*FakeMetrics) AddSample

func (m *FakeMetrics) AddSample(key []string, val float32)

func (*FakeMetrics) AddSampleWithLabels

func (m *FakeMetrics) AddSampleWithLabels(key []string, val float32, labels []telemetry.Label)

func (*FakeMetrics) AllMetrics

func (m *FakeMetrics) AllMetrics() []MetricItem

AllMetrics return all collected metrics

func (*FakeMetrics) EmitKey

func (m *FakeMetrics) EmitKey(key []string, val float32)

func (*FakeMetrics) IncrCounter

func (m *FakeMetrics) IncrCounter(key []string, val float32)

func (*FakeMetrics) IncrCounterWithLabels

func (m *FakeMetrics) IncrCounterWithLabels(key []string, val float32, labels []telemetry.Label)

func (*FakeMetrics) MeasureSince

func (m *FakeMetrics) MeasureSince(key []string, _ time.Time)

func (*FakeMetrics) MeasureSinceWithLabels

func (m *FakeMetrics) MeasureSinceWithLabels(key []string, _ time.Time, labels []telemetry.Label)

func (*FakeMetrics) Reset

func (m *FakeMetrics) Reset()

func (*FakeMetrics) SetGauge

func (m *FakeMetrics) SetGauge(key []string, val float32)

func (*FakeMetrics) SetGaugeWithLabels

func (m *FakeMetrics) SetGaugeWithLabels(key []string, val float32, labels []telemetry.Label)

type MetricItem

type MetricItem struct {
	Type   MetricType
	Key    []string
	Val    float32
	Labels []telemetry.Label
	Start  time.Time
}

type MetricType

type MetricType int
const (
	SetGaugeType MetricType = iota
	SetGaugeWithLabelsType
	EmitKeyType
	IncrCounterType
	IncrCounterWithLabelsType
	AddSampleType
	AddSampleWithLabelsType
	MeasureSinceType
	MeasureSinceWithLabelsType
)

Jump to

Keyboard shortcuts

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