kit: github.com/go-kit/kit/metrics/internal/lv Index | Files

package lv

import "github.com/go-kit/kit/metrics/internal/lv"

Index

Package Files

labelvalues.go space.go

type LabelValues Uses

type LabelValues []string

LabelValues is a type alias that provides validation on its With method. Metrics may include it as a member to help them satisfy With semantics and save some code duplication.

func (LabelValues) With Uses

func (lvs LabelValues) With(labelValues ...string) LabelValues

With validates the input, and returns a new aggregate labelValues.

type Space Uses

type Space struct {
    // contains filtered or unexported fields
}

Space represents an N-dimensional vector space. Each name and unique label value pair establishes a new dimension and point within that dimension. Order matters, i.e. [a=1 b=2] identifies a different timeseries than [b=2 a=1].

func NewSpace Uses

func NewSpace() *Space

NewSpace returns an N-dimensional vector space.

func (*Space) Add Uses

func (s *Space) Add(name string, lvs LabelValues, delta float64)

Add locates the time series identified by the name and label values in the vector space, and appends the delta to the last value in the list of observations.

func (*Space) Observe Uses

func (s *Space) Observe(name string, lvs LabelValues, value float64)

Observe locates the time series identified by the name and label values in the vector space, and appends the value to the list of observations.

func (*Space) Reset Uses

func (s *Space) Reset() *Space

Reset empties the current space and returns a new Space with the old contents. Reset a Space to get an immutable copy suitable for walking.

func (*Space) Walk Uses

func (s *Space) Walk(fn func(name string, lvs LabelValues, observations []float64) bool)

Walk traverses the vector space and invokes fn for each non-empty time series which is encountered. Return false to abort the traversal.

Package lv imports 1 packages (graph) and is imported by 16 packages. Updated 2017-01-11. Refresh now. Tools for package owners.