metrics

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package metrics will allow us to publish/report metrics to measure and manage netmux operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter interface {
	Add(value float64)
}

Observer implements the last mile collector to a metric. Ideally all preparation to report metrics should be chached by this entity.

type Factory

type Factory interface {
	New(m string, params ...string) Metric
}

Factory allows creation of metrics.

type Metric

type Metric interface {
	Counter(labels map[string]string) Counter
}

Metric represents one data point to be collected. Since it may have flags/labels, we use it as an intermediary entity. An observer should be created from the metric for further reporting.

type PromCounter

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

func (*PromCounter) Add

func (s *PromCounter) Add(value float64)

type PromFactory

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

func NewPromFactory

func NewPromFactory() *PromFactory

func (*PromFactory) New

func (p *PromFactory) New(metric string, labels ...string) Metric

func (*PromFactory) Start

func (p *PromFactory) Start(ctx context.Context, addr string) error

type PromMetric

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

func (*PromMetric) Counter

func (p *PromMetric) Counter(labels map[string]string) Counter

type StdoutCounter

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

func (*StdoutCounter) Add

func (s *StdoutCounter) Add(value float64)

type StdoutFactory

type StdoutFactory struct{}

func NewStdoutFactory

func NewStdoutFactory() *StdoutFactory

func (*StdoutFactory) New

func (s *StdoutFactory) New(m string, _ ...string) Metric

type StdoutMetric

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

func (*StdoutMetric) Counter

func (s *StdoutMetric) Counter(labels map[string]string) Counter

Jump to

Keyboard shortcuts

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