metrics

package
v0.0.0-...-27647ab Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Count

func Count(mtr Metrics, name string, value float64, tags Tags)

func Gauge

func Gauge(mtr Metrics, name string, value float64, tags Tags)

func Histogram

func Histogram(mtr Metrics, name string, value float64, tags Tags)

func Rate

func Rate(mtr Metrics, name string, value float64, tags Tags)

Types

type Metric

type Metric struct {
	Kind  MetricKind
	Name  string
	Value float64
	Tags  Tags
}

func MakeMetric

func MakeMetric(kind MetricKind, name string, value float64, tags Tags) Metric

type MetricKind

type MetricKind int8
const (
	InvalidKind MetricKind = iota
	CountKind
	RateKind
	GaugeKind
	HistogramKind
)

type Metrics

type Metrics interface {
	EmitMetric(m Metric)
}

type NopMetrics

type NopMetrics struct{}

func (NopMetrics) EmitMetric

func (n NopMetrics) EmitMetric(m Metric)

type Tag

type Tag = bt.Kv[string, string]

type Tags

type Tags = []Tag

Jump to

Keyboard shortcuts

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