monitor

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Monitor

type Monitor interface {

	// Stats
	Duration(contextTag, key string, start time.Time, tags ...string)
	Gauge(contextTag, key string, value float64, tags ...string)
	Histogram(contextTag, key string, value float64, tags ...string)
	Count1(contextTag, key string, tags ...string)
	Count(contextTag, key string, amount int64, tags ...string)

	// Logging
	Debug(f string, v ...interface{})
	Info(f string, v ...interface{})
	Warning(err error)
	Error(err error)
}

Monitor represents a contract that a monitor should implement

func New

func New(log logging.Logger, stats StatsdClient, appname string, env string) Monitor

New ...

func NewNoop

func NewNoop() Monitor

NewNoop ...

type StatsdClient

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

StatsdClient ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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