metrics

package
v0.0.0-...-e83a2f5 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryData

type MemoryData struct {
	Counters map[string]struct {
		Count int64
		Tags  map[string]string
	}
	Rate map[string]struct {
		Rate float64
		Tags map[string]string
	}
	Gauge map[string]struct {
		Mean   float64
		Sum    float64
		Min    float64
		Median float64
		Max    float64
		P9999  float64
		P999   float64
		P99    float64
		P95    float64
		P90    float64
		P75    float64
		P50    float64
		Tags   map[string]string
	}
}

type Metric

type Metric interface {
	Add(float64)
	Type() Type
}

func Counter

func Counter(name string, tags map[string]string) Metric

func Gauge

func Gauge(name string, tags map[string]string) Metric

func Rate

func Rate(name string, tags map[string]string) Metric

type Reporter

type Reporter interface {
	Finish() error
	Collect(metrics ...Metric)
	// contains filtered or unexported methods
}

func Console

func Console() Reporter

func Influx

func Influx(writeAPI influxdb2api.WriteAPI, interval time.Duration, name string) Reporter

func Memory

func Memory(data *MemoryData) Reporter

func Statsd

func Statsd(client *gostatsd.Client, interval time.Duration, name string) Reporter

type Type

type Type uint
const (
	CounterMetric Type = iota
	GaugeMetric
	RateMetric
)

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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