metrics

package
v0.0.0-...-092457b Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ElapsedBucketsInMs = []float64{
		0, 10, 20, 30, 40, 50, 60, 70, 80, 90,
		100, 200, 300, 400, 500, 600, 700, 800, 900,
		1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000,
	}
)

Functions

func CounterAdd

func CounterAdd(name string, v float64)

func CounterInc

func CounterInc(name string)

func ElapsedMs

func ElapsedMs(name string) func()

func GaugeAdd

func GaugeAdd(name string, v float64)

func GaugeDec

func GaugeDec(name string)

func GaugeInc

func GaugeInc(name string)

func GaugeSet

func GaugeSet(name string, v float64)

func HistAdd

func HistAdd[T number](name string, v T)

func Init

func Init(ctx context.Context, namespace string, port int)

func NewCounter

func NewCounter(name string)

NewCounter declares a new counter.

func NewGauge

func NewGauge(name string)

NewGauge declares a new gauge.

func NewHistogram

func NewHistogram(
	name string,
	buckets ...float64,
)

NewHistogram declares a new histogram. Buckets defines the buckets into which observations are counted. Each element in the slice is the upper inclusive bound of a bucket. The values must be sorted in strictly increasing order. There is no need to add a highest bucket with +Inf bound, it will be added implicitly. If Buckets is left as nil or set to a slice of length zero, it is replaced by default buckets. The default buckets are DefBuckets if no buckets for a native histogram (see below) are used, otherwise the default is no buckets. (In other words, if you want to use both reguler buckets and buckets for a native histogram, you have to define the regular buckets here explicitly.)

func RegisterDiskMetrics

func RegisterDiskMetrics(ctx context.Context) error

func RegisterIfaceMetrics

func RegisterIfaceMetrics(ctx context.Context) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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