fakemetrics

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 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, start time.Time)

func (*FakeMetrics) MeasureSinceWithLabels

func (m *FakeMetrics) MeasureSinceWithLabels(key []string, start 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