l2met

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package l2met implements an l2met stats client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type L2met

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

L2met is a l2met client.

func New

func New(l Logger, prefix string, opts ...OptsFunc) *L2met

New returns a l2met instance.

func (*L2met) Close

func (s *L2met) Close() error

Close closes the client and flushes buffered stats, if applicable.

func (*L2met) Gauge

func (s *L2met) Gauge(name string, value float64, rate float32, tags ...string)

Gauge measures the value of a metric.

func (*L2met) Inc

func (s *L2met) Inc(name string, value int64, rate float32, tags ...string)

Inc increments a count by the value.

func (*L2met) Timing

func (s *L2met) Timing(name string, value time.Duration, rate float32, tags ...string)

Timing sends the value of a Duration.

type Logger

type Logger interface {
	Info(msg string, ctx ...interface{})
}

Logger represents an abstract logging object.

type OptsFunc

type OptsFunc func(*L2met)

OptsFunc represents a function that configures L2met.

func UseRates

func UseRates() OptsFunc

UseRates turns on sample rates in l2met.

func UseSampler

func UseSampler(sampler SamplerFunc) OptsFunc

UseSampler sets the sampler function for l2met.

type SamplerFunc

type SamplerFunc func(float32) bool

SamplerFunc represents a function that samples the L2met stats.

Jump to

Keyboard shortcuts

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