met

package module
v0.0.0-...-80f9c6e Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: Apache-2.0 Imports: 1 Imported by: 71

README

an opinionated wrapper around metric client libraries

imported from Grafana ffcc807ed34f853a8bc9600bcf7801547a5feb4f

supports:

  • statsd (recommended!)
  • dogstatsd

and later maybe more, like go-metrics

Why?

  • make it easy to switch between libraries.
  • some libraries just take in string arguments for gauge names etc, but it's nicer to have variables per object for robustness, especially when used in multiple places, and gives a central overview.
  • allows you to set deleteGauges and deleteStats in your statsd servers ( a good thing for stateless servers), cause we will automatically keep a gauge sending.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	NewCount(key string) Count
	NewGauge(key string, val int64) Gauge
	NewMeter(key string, val int64) Meter
	NewTimer(key string, val time.Duration) Timer
}

type Count

type Count interface {
	Inc(val int64)
}

Count is a type that counts how many hits it's seen in each given interval and computes the rate per second it's not a long-running counter. values are explicit

type Gauge

type Gauge interface {
	Dec(val int64)
	Inc(val int64)
	Value(val int64)
}

gauge makes sure its value is explicit (i.e. for statsd, keep sending)

type Meter

type Meter interface {
	Value(val int64)
}

like a timer, but not just for timings

type Timer

type Timer interface {
	Value(val time.Duration)
}

computes stasticical summaries

Directories

Path Synopsis
it's commonly used for non-timer cases where we want these summaries, that's what this is for.
it's commonly used for non-timer cases where we want these summaries, that's what this is for.
it's commonly used for non-timer cases where we want these summaries, that's what this is for.
it's commonly used for non-timer cases where we want these summaries, that's what this is for.

Jump to

Keyboard shortcuts

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