metrics

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DatadogIP   string
	DatadogPort string
	AppName     string
	Env         string
}

type Metrics

type Metrics struct {
	Client *statsd.Client
	// contains filtered or unexported fields
}

Metrics wrapper for customized statsd

func NewMetrics

func NewMetrics(cfg *Config) (*Metrics, error)

func (*Metrics) Close

func (s *Metrics) Close() error

func (*Metrics) Count

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

func (*Metrics) Decr

func (s *Metrics) Decr(name string, tags []string, rate float64) error

func (*Metrics) Event

func (s *Metrics) Event(e *statsd.Event) error

func (*Metrics) Gauge

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

func (*Metrics) Incr

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

func (*Metrics) ServiceCheck

func (s *Metrics) ServiceCheck(sc *statsd.ServiceCheck) error

func (*Metrics) SimpleEvent

func (s *Metrics) SimpleEvent(title, text string) error

type NoopMetrics

type NoopMetrics struct{}

func NewNoopMetrics

func NewNoopMetrics() (*NoopMetrics, error)

func (*NoopMetrics) Close

func (s *NoopMetrics) Close() error

func (*NoopMetrics) Count

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

func (*NoopMetrics) Decr

func (s *NoopMetrics) Decr(name string, tags []string, rate float64) error

func (*NoopMetrics) Event

func (s *NoopMetrics) Event(e *statsd.Event) error

func (*NoopMetrics) Gauge

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

func (*NoopMetrics) Incr

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

func (*NoopMetrics) ServiceCheck

func (s *NoopMetrics) ServiceCheck(sc *statsd.ServiceCheck) error

func (*NoopMetrics) SimpleEvent

func (s *NoopMetrics) SimpleEvent(title, text string) error

Jump to

Keyboard shortcuts

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