Documentation ¶
Overview ¶
Package metrics provides a simple dummy StatsD logging server for local development
Adapted from http://lee.hambley.name/2013/01/26/dirt-simple-statsd-server-for-local-development.html
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultAddress = ":8125"
DefaultAddress to listen for metrics on
View Source
var DefaultOutput io.Writer = os.Stdout
DefaultOutput where to output the logs
Functions ¶
func WithFormatter ¶
func WithFormatter(formatter MetricFormatter) func(*server)
WithFormatter is is provided as an option to New to specify a custom formatter usage:
statsdLogger.New("0.0.0.0:8125", WithFormatter(myCustomFormatter))
func WithWriter ¶
WithWriter is is provided as an option to New to specify a custom io.Writer to output logs usage:
statsdLogger.New("0.0.0.0:8125", WithWriter(os.Stderr))
Types ¶
type Metric ¶
Metric is an intermediate representation of a raw statsd metric for easier presentation
type MetricFormatter ¶
MetricFormatter formats metrics as a string for logging
var DefaultFormatter MetricFormatter = colorFormatter{}
DefaultFormatter provides output format for metrics
Click to show internal directories.
Click to hide internal directories.