metrics

package
v0.0.0-...-4fdfd55 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled         bool
	DatadogAgentURL string
}

Config provides the configuration required by the metric package.

func NewConfig

func NewConfig() Config

NewConfig returns a new instance of Config.

func (Config) Validate

func (c Config) Validate() error

Validate returns an error if the config is invalid.

type Counter

type Counter interface {
	With(Tag) Counter
	Add(delta int64)
}

Counter is the most basic and default metric type. It is treated as a count of a type of event per second and are typically averaged over on minute. That is, when looking at a graph, you are usually seeing the average number of events per second during a one-minute period.

type Gauge

type Gauge interface {
	With(Tag) Gauge
	Set(value float64)
}

Gauge is a constant metric type. Gauges are not subject to averaging and do not change unless they are changed. That is, once a gauge value is set, it will be a flat line on the graph until it is changed again.

Examples: system load, active WebSocket connections

type Tag

type Tag struct {
	Key   string
	Value string
}

Tag is a key-value pair which can be associated with a metric in order to add additional information.

type TimeHistogram

type TimeHistogram interface {
	With(Tag) TimeHistogram
	Observe(d time.Duration)
}

TimeHistogram calculate the statistical distribution of any kind of value over time. An example of a histogram is the request latency.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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