metrics

package
v0.0.0-...-95b87ed Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(opts Opts) (err error)

func Shutdown

func Shutdown() error

func Start

func Start() error

Types

type Counter

type Counter interface {
	Inc(delta int64)
}

type CounterOpts

type CounterOpts struct {
	Namespace string
	Subsystem string
	Name      string

	Help string

	LabelNames []string

	LabelHelp map[string]string

	StatsdFormat string
}

type Gauge

type Gauge interface {
	Update(value float64)
}

type GaugeOpts

type GaugeOpts struct {
	Namespace string
	Subsystem string
	Name      string

	Help string

	LabelNames []string

	LabelHelp map[string]string

	StatsdFormat string
}

type Histogram

type Histogram interface {
	With(labelValues ...string) Histogram
	Observe(value float64)
}

type HistogramOpts

type HistogramOpts struct {
	Namespace string
	Subsystem string
	Name      string

	Help string

	Buckets []float64

	LabelNames []string

	LabelHelp map[string]string

	StatsdFormat string
}

type Opts

type Opts struct {
	Reporter           string
	Interval           time.Duration
	Enabled            bool
	StatsdReporterOpts StatsdReporterOpts
	PromReporterOpts   PromReporterOpts
}

func NewOpts

func NewOpts() Opts

type PromReporterOpts

type PromReporterOpts struct {
	ListenAddress string
}

type Provider

type Provider interface {
	NewCounter(CounterOpts) Counter

	NewGauge(GaugeOpts) Gauge

	NewHistogram(HistogramOpts) Histogram
}

type Scope

type Scope interface {
	Counter(name string) Counter

	Gauge(name string) Gauge

	Tagged(tags map[string]string) Scope

	SubScope(name string) Scope
	// contains filtered or unexported methods
}
var RootScope Scope

type StatsdReporterOpts

type StatsdReporterOpts struct {
	Address       string
	FlushInterval time.Duration
	FlushBytes    int
}

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

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