metrics

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2020 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableRuntimeMetrics added in v0.0.2

func EnableRuntimeMetrics(ctx context.Context)

func Gauge

func Gauge(name string, value float64, tags []string)

Gauge publishes the gauge type metrics

func GaugeI

func GaugeI(name string, value int, tags []string)

GaugeI is same as Gauge but it accepts the metric value as an integer

func Incr

func Incr(name string, tags []string)

Incr publishes the counter type metrics

func SetSink

func SetSink(sink Sink)

SetupSink initializes the metrics subsystem.

func Timed

func Timed(name string, start time.Time, tags []string)

Timed publishes gauge type metrics with their value set to the nanosecond difference in current time and the value of `start`.

Types

type FileSink

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

func (*FileSink) Gauge

func (s *FileSink) Gauge(name string, value float64, tags []string, rate float64) error

func (*FileSink) Incr

func (s *FileSink) Incr(name string, tags []string, rate float64) error

type NoOpSink

type NoOpSink struct{}

func (*NoOpSink) Gauge

func (s *NoOpSink) Gauge(string, float64, []string, float64) error

func (*NoOpSink) Incr

func (s *NoOpSink) Incr(string, []string, float64) error

type Sink

type Sink interface {
	Gauge(string, float64, []string, float64) error
	Incr(string, []string, float64) error
}

func NewFileSink

func NewFileSink(out io.Writer, format string) Sink

func NewNoOpSink

func NewNoOpSink() Sink

func NewStatsdSink

func NewStatsdSink(addr string, port int, ns string) (Sink, error)

addr is the host address where the statsd agent can be reached. port defines the network port to use for communication. ns is used as a prefix for all metrics that are published by flightpath.

Jump to

Keyboard shortcuts

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