statsutils

package
v1.17.8 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Int64Measure

func Int64Measure(name, description string) *stats.Int64Measure

Int64Measure returns a new Int64Measure with the given name and description

func MakeCounter

func MakeCounter(name, description string, aggregation *view.Aggregation, tagKeys ...tag.Key) *stats.Int64Measure

MakeCounter returns a new counter with the given name, description, aggregation, and tag keys

func MakeGauge

func MakeGauge(name, description string, tagKeys ...tag.Key) *stats.Int64Measure

MakeGauge returns a new gauge with the given name and description

func MakeLastValueCounter

func MakeLastValueCounter(name, description string, tagKeys ...tag.Key) *stats.Int64Measure

MakeLastValueCounter returns a counter with a LastValue aggregation for the given name, description, and tag keys

func MakeSumCounter

func MakeSumCounter(name, description string, tagKeys ...tag.Key) *stats.Int64Measure

MakeSumCounter returns a new counter with a Sum aggregation for the given name, description, and tag keys

func Measure

func Measure(ctx context.Context, counter *stats.Int64Measure, val int64, tags ...tag.Mutator)

Measure records the given value to the given counter

func MeasureOne

func MeasureOne(ctx context.Context, counter *stats.Int64Measure, tags ...tag.Mutator)

MeasureOne records a one value to the given counter

func MeasureZero

func MeasureZero(ctx context.Context, counter *stats.Int64Measure, tags ...tag.Mutator)

MeasureZero records a zero value to the given counter

func ViewForCounter

func ViewForCounter(counter *stats.Int64Measure, aggregation *view.Aggregation, tagKeys ...tag.Key) *view.View

ViewForCounter returns a view for the given measure with the given aggregation and tag keys

Types

type StopWatch

type StopWatch interface {
	Start()
	Stop(ctx context.Context) time.Duration
}

StopWatch is a stopwatch that records the duration of an operation and records an opencensus metric for the time between Start and Stop

func NewStopWatch

func NewStopWatch(measure *stats.Float64Measure, labels ...tag.Mutator) StopWatch

NewStopWatch creates a new StopWatch that records the duration of an operation and records an opencensus metric for the time between Start and Stop The metric is recorded with the provided measurement and labels as a tag

func NewTranslatorStopWatch

func NewTranslatorStopWatch(translatorName string) StopWatch

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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