metrics

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedMetricType = errors.New(`unsupported metric type`)

ErrUnsupportedMetricType value

Functions

This section is empty.

Types

type Metric

type Metric struct {
	Namespace string              `json:"namespace,omitempty"`
	Subsystem string              `json:"subsystem,omitempty"`
	Name      string              `json:"name"`
	Type      MetricType          `json:"type"`
	Tags      []map[string]string `json:"tags,omitempty"`
}

Metric config type

func (*Metric) Labels

func (m *Metric) Labels() []string

Labels list of tags

func (*Metric) Metric

func (m *Metric) Metric() (Metricer, error)

Metric returns metric processor

type MetricList

type MetricList []*Metric

MetricList extender

func (MetricList) Metric

func (l MetricList) Metric() (Metricer, error)

Metric executer of the

type MetricType

type MetricType string

MetricType of the metric

const (
	MetricCounter MetricType = "counter"
)

Metric types list

func (MetricType) IsCounter

func (mt MetricType) IsCounter() bool

IsCounter type of the metric

type Metricer

type Metricer interface {
	Exec(ctx context.Context, msg message.Message)
}

Metricer executor

type MetricerList

type MetricerList []Metricer

MetricerList wrapper

func (MetricerList) Exec

func (l MetricerList) Exec(ctx context.Context, msg message.Message)

Execute all metrics frin the list

Jump to

Keyboard shortcuts

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