metrics

package
v0.0.0-...-c3677c5 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTags = map[string]string{}

DefaultTags are automatically added to all published metrics

View Source
var MetricsPublisherDisabled = false

MetricsPublisherDisabled short circuits publishing to Atlas

Functions

func PublishCounter

func PublishCounter(name string, tags map[string]string, value int)

PublishCounter creates, and pushes a counter to Atlas with a specific value

func PublishGauge

func PublishGauge(name string, value int)

PublishGauge creates, and pushes a gauge to Atlas with default tags

func PublishGaugeWithTags

func PublishGaugeWithTags(name string, value int, tags map[string]string)

PublishGaugeWithTags creates, and pushes a gauge to Atlas with specific tags

func PublishIncrementCounter

func PublishIncrementCounter(name string)

PublishIncrementCounter creates, and pushes a counter to Atlas with a value of 1

func PublishTimer

func PublishTimer(name string, value time.Duration)

PublishTimer creates, and pushes a gauge to Atlas with default tags

func PublishTimerWithTags

func PublishTimerWithTags(name string, value time.Duration, tags map[string]string)

PublishTimerWithTags creates, and pushes a timer to Atlas with specific tags

Types

type StopWatch

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

StopWatch is used to measure durations

func NewStopWatch

func NewStopWatch() *StopWatch

NewStopWatch initializes a Stopwatch with the current time

func (*StopWatch) GetDelta

func (sw *StopWatch) GetDelta() time.Duration

GetDelta returns the time elapsed since the time the stopwatch was set

func (*StopWatch) Publish

func (sw *StopWatch) Publish(name string)

Publish sends the current state of the stopwatch to Atlas

func (*StopWatch) Reset

func (sw *StopWatch) Reset()

Reset sets the stopwatch to the current time

Jump to

Keyboard shortcuts

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