package metrics
import "github.com/go-kit/kit/metrics"
Package metrics provides an extensible framework to instrument your application. All metrics are safe for concurrent use. Considerable design influence has been taken from https://github.com/codahale/metrics and https://prometheus.io.
Index ¶
- func PrintDistribution(w io.Writer, h Histogram)
- type Bucket
- type Counter
- type Field
- type Gauge
- type Histogram
- func NewMultiHistogram(name string, histograms ...Histogram) Histogram
- func NewScaledHistogram(h Histogram, scale int64) Histogram
- type Quantile
- type TimeHistogram
Functions ¶
func PrintDistribution ¶
PrintDistribution writes a human-readable graph of the distribution to the passed writer.
Types ¶
type Bucket ¶
Bucket is a range in a histogram which aggregates observations.
type Counter ¶
Counter is a monotonically-increasing, unsigned, 64-bit integer used to capture the number of times an event has occurred. By tracking the deltas between measurements of a counter over intervals of time, an aggregation layer can derive rates, acceleration, etc.
func NewMultiCounter ¶
NewMultiCounter returns a wrapper around multiple Counters.
type Field ¶
Field is a key/value pair associated with an observation for a specific metric. Fields may be ignored by implementations.
type Gauge ¶
type Gauge interface { Name() string With(Field) Gauge Set(value float64) Add(delta float64) Get() float64 }
Gauge captures instantaneous measurements of something using signed, 64-bit floats. The value does not need to be monotonic.
func NewMultiGauge ¶
NewMultiGauge returns a wrapper around multiple Gauges.
type Histogram ¶
type Histogram interface { Name() string With(Field) Histogram Observe(value int64) Distribution() ([]Bucket, []Quantile) }
Histogram tracks the distribution of a stream of values (e.g. the number of milliseconds it takes to handle requests). Implementations may choose to add gauges for values at meaningful quantiles.
func NewMultiHistogram ¶
NewMultiHistogram returns a wrapper around multiple Histograms.
func NewScaledHistogram ¶
NewScaledHistogram returns a Histogram whose observed values are downscaled (divided) by scale.
type Quantile ¶
Quantile is a pair of quantile (0..100) and its observed maximum value.
type TimeHistogram ¶
type TimeHistogram interface { With(Field) TimeHistogram Observe(time.Duration) }
TimeHistogram is a convenience wrapper for a Histogram of time.Durations.
func NewTimeHistogram ¶
func NewTimeHistogram(unit time.Duration, h Histogram) TimeHistogram
NewTimeHistogram returns a TimeHistogram wrapper around the passed Histogram, in units of unit.
Source Files ¶
metrics.go multi.go print.go scaled_histogram.go time_histogram.go
Directories ¶
Path | Synopsis |
---|---|
metrics/discard | Package discard implements a backend for package metrics that succeeds without doing anything. |
metrics/dogstatsd | Package dogstatsd implements a DogStatsD backend for package metrics. |
metrics/expvar | Package expvar implements an expvar backend for package metrics. |
metrics/graphite | Package graphite implements a Graphite backend for package metrics. |
metrics/influxdb | Package influxdb implements a InfluxDB backend for package metrics. |
metrics/prometheus | Package prometheus implements a Prometheus backend for package metrics. |
metrics/provider | |
metrics/statsd | Package statsd implements a statsd backend for package metrics. |
metrics/teststat | Package teststat contains helper functions for statistical testing of metrics implementations. |
- Version
- v0.1.0
- Published
- Jun 7, 2016
- Platform
- js/wasm
- Imports
- 4 packages
- Last checked
- 3 days ago –
Tools for package owners.