metrics

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package metrics provides a metrics wrapper.

Metrics must be initialized at startup as early as possible:

import "github.com/chronomq/chronomq/pkg/metrics"
...
metrics.InitMetrics(metricsCollectorAddr)

Index

Constants

This section is empty.

Variables

View Source
var Client *statsd.Client

Client is the global metrics client for sending statsd compatible metrics

Functions

func Decr

func Decr(name string) error

Decr decrements the given metric name

func Gauge

func Gauge(name string, val float64) error

Gauge sends a gauge metric

func GaugeInt

func GaugeInt(name string, val int) error

GaugeInt sends a gauge metric

func Incr

func Incr(name string) error

Incr increments the given metric name

func InitMetrics

func InitMetrics(statsAddr string)

InitMetrics idempotently initializes a Client

func Time

func Time(name string, start time.Time) error

Time sends timing metrics when called. Ideally used with defer as Time("metricname", time.Now())

Types

This section is empty.

Jump to

Keyboard shortcuts

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