metricdeconstructor

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSkipMetric = errors.New("skip metric")

ErrSkipMetric is returned when parsing to indicate skipping

Functions

This section is empty.

Types

type IdentityMetricDeconstructor

type IdentityMetricDeconstructor struct{}

IdentityMetricDeconstructor returns a zero dimension gauge of a metric

func (*IdentityMetricDeconstructor) Parse

func (parser *IdentityMetricDeconstructor) Parse(originalMetric string) (string, datapoint.MetricType, map[string]string, error)

Parse returns the zero dimension gauge

type MetricDeconstructor

type MetricDeconstructor interface {
	Parse(originalMetric string) (newMetric string, mtype datapoint.MetricType, dimension map[string]string, err error)
}

MetricDeconstructor is an object that can deconstruct a single metric name into what dimensions it should represent. Useful for compatibility with non dimensioned stores, like graphite

func Load

func Load(name string, options string) (MetricDeconstructor, error)

Load will load a MetricDeconstructor of the given name, with the given options

func LoadJSON

func LoadJSON(name string, options map[string]interface{}) (MetricDeconstructor, error)

LoadJSON will load a MetricDeconstructor of the given name, with the given JSON object

type NilDeconstructor

type NilDeconstructor struct{}

NilDeconstructor is a parser that always skips a metric

func (*NilDeconstructor) Parse

func (m *NilDeconstructor) Parse(originalMetric string) (string, datapoint.MetricType, map[string]string, error)

Parse always returns an error

Jump to

Keyboard shortcuts

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