scopedstatsd

package
v13.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Gauge(name string, value float64, tags []string, rate float64) error
	Count(name string, value int64, tags []string, rate float64) error
	Incr(name string, tags []string, rate float64) error
	Histogram(name string, value float64, tags []string, rate float64) error
	TimeInMilliseconds(name string, value float64, tags []string, rate float64) error
	Timing(name string, value time.Duration, tags []string, rate float64) error
}

StatsdClient represents the statsd client functions that veneur's SSF sinks call (so as not to write-amplify by reporting its own metrics).

func Ensure

func Ensure(cl Client) Client

Ensure takes a statsd client and wraps it in such a way that it is safe to store in a struct if it should be nil. Otherwise returns the Client unchanged.

type MetricScopes

type MetricScopes struct {
	Gauge     ssf.SSFSample_Scope
	Count     ssf.SSFSample_Scope
	Histogram ssf.SSFSample_Scope
}

MetricScopes holds the scopes that are configured for each metric type.

type ScopedClient

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

func NewClient

func NewClient(inner *statsd.Client, addTags []string, scopes MetricScopes) *ScopedClient

func (*ScopedClient) Count

func (s *ScopedClient) Count(name string, value int64, tags []string, rate float64) error

func (*ScopedClient) Gauge

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

func (*ScopedClient) Histogram

func (s *ScopedClient) Histogram(name string, value float64, tags []string, rate float64) error

func (*ScopedClient) Incr

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

func (*ScopedClient) TimeInMilliseconds

func (s *ScopedClient) TimeInMilliseconds(name string, value float64, tags []string, rate float64) error

func (*ScopedClient) Timing

func (s *ScopedClient) Timing(name string, value time.Duration, tags []string, rate float64) error

Jump to

Keyboard shortcuts

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