Documentation ¶
Overview ¶
Package metrics provides storage for metrics being recorded by mtail programs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Datum ¶
Datum describes a LabelSet's or LabelValue's value at a given timestamp.
type Incrementable ¶
Incrementable describes an interface for Counter Kinds, that must be nondecreasing.
type Kind ¶
type Kind int
Kind enumerates the types of metrics supported.
const ( // Counter is a Kind that is nondecreasing, typically only // incrementable. Counter Kind // Gauge is a Kind that can take on any value, and may be set // discontinuously from its previous value. Gauge // Timer is a specialisation of Gauge that can be used to store time // intervals, such as latency and durations. It enables certain behaviour // in exporters that handle time intervals such as StatsD. Timer )
type LabelSet ¶
LabelSet is an object that maps the keys of a Metric to the labels naming a Datum, for use when enumerating Datums from a Metric.
type LabelValue ¶
LabelValue is an object that names a Datum value with a list of label strings.
func (*LabelValue) String ¶
func (lv *LabelValue) String() string
type Metric ¶
type Metric struct { sync.RWMutex Name string // Name Program string // Instantiating program Kind Kind Keys []string `json:",omitempty"` LabelValues []*LabelValue `json:",omitempty"` }
Metric is an object that describes a metric, with its name, the creator and owner program name, its Kind, a sequence of Keys that may be used to add dimension to the metric, and a list of LabelValues that contain data for labels in each dimension of the Keys.
func (*Metric) EmitLabelSets ¶
EmitLabelSets enumerates the LabelSets corresponding to the LabelValues of a Metric. It emits them onto the provided channel, then closes the channel to signal completion.
type Settable ¶
Settable describes an interface for Gauge Kinds, that can be set to any value discontinuously from its previous.