Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics defines a set of metric collection.
func (*Metrics) Increment ¶
Increment adds the given value to a counter or gauge metric. The name and labels must match a previously defined metric. Gauge metrics support subtraction by use of a negative value. Counter metrics only allow addition and a negative value will result in an error.
func (*Metrics) Observe ¶
Observe observes the given value using a histogram or summary, or sets it as a gauge's value. The name and labels must match a previously defined metric.
type Option ¶
type Option func(c *metric) error
An Option is used to construct a metric.
func Counter ¶
func Counter() Option
Counter represents a single numerical value that only ever goes up.
func Gauge ¶
func Gauge() Option
Gauge represents a single numerical value that can arbitrarily go up and down.
func Histogram ¶
Histogram counts individual observations from an event or sample stream in configurable buckets.
Warning: Histograms are expensive and should be used sparingly.
func MaxAge ¶
MaxAge defines the duration for which an observation stays relevant for summary metrics. Must be positive.
func Summary ¶
Summary captures individual observations from an event or sample stream and summarizes them in a manner similar to traditional summary statistics: 1. sum of observations 2. observation count 3. rank estimations.
Warning: Summaries with objectives are expensive and should be used sparingly.