metrics

package
v0.0.0-...-62b679d Latest Latest
Warning

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

Go to latest
Published: May 24, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeSeries

func MakeSeries(name string, tags map[string]string, field string) string

MakeSeries creates Series in influxdb format: <measurement>,<tag1>=<key1>,<tagN>=<keyN) <field1>=

func Reset

func Reset()

Reset clears all counters and gauges.

func Snapshot

func Snapshot() (c map[string]uint64, g map[string]int64)

Snapshot provides all collected metrics.

func SnapshotLines

func SnapshotLines() string

SnapshotLines provies all collected metrics in Line protocol format. https://github.com/influxdata/influxdb/blob/master/tsdb/README.md

Types

type Counter

type Counter struct {
	Name  string
	Tags  map[string]string
	Field string
	// contains filtered or unexported fields
}

Counter inherits metrics.Counter and provides counter in influxdb format. Use a counter to derive rates (e.g., record total number of requests, derive requests per second).

func NewCounter

func NewCounter(name string, tags map[string]string, field string) *Counter

NewCounter returns new instance of Counter.

type Gauge

type Gauge struct {
	Name  string
	Tags  map[string]string
	Field string
	// contains filtered or unexported fields
}

Gauge inherits metrics.Gauge and provides gauges in influxdb format. A Gauge is an instantaneous measurement of a value.

Use a gauge to track metrics which increase and decrease (e.g., amount of free memory).

func NewGauge

func NewGauge(name string, tags map[string]string, field string) *Gauge

NewCounter returns new instance of Counter

type Histogram

type Histogram struct {
	*metrics.Histogram
}

A Histogram measures the distribution of a stream of values. Use a histogram to track the distribution of a stream of values (e.g., the latency associated with HTTP requests).

func NewHistogram

func NewHistogram(name string, tags map[string]string, field string, minValue, maxValue int64) *Histogram

Jump to

Keyboard shortcuts

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