# Functions
Absolute calls Absolute on DefaultStatsd.
Close calls Close on DefaultStatsd.
CreateSocket calls CreateSocket on DefaultStatsd.
Decr calls Decr on DefaultStatsd.
Duration provided a start time in milliseconds, returns the difference / duration between that time and the time of Duration being called as an int64.
FAbsolute calls FAbsolute on DefaultStatsd.
FGauge calls FGauge on DefaultStatsd.
FGaugeDelta calls FGaugeDelta on DefaultStatsd.
Gauge calls Gauge on DefaultStatsd.
GaugeDelta calls GaugeDelta on DefaultStatsd.
Handler provides a middleware that will report how much time the wrapped handler took.
HandlerFunc is a convenience method to wrap http.HandlerFunc with the middleware.
HandlerFuncCtx is the same implementation as Handler but accepts context.Context as the first parameter.
Incr calls Incr on DefaultStatsd.
IncrPanic increment number of panics of the app.
InstrumentRouter walks all the handlers on a mux.Router and wraps each route's handler with a metrics Handler for reporting sanitized route timing metrics.
Middleware is a metrics handler middleware.
MSTime returns the current time in milliseconds.
NewConfig prepares a new configuration for parsing CLI flags.
NewLoggingClient creates a new logging client that will log to logger.
NewTimer convenience function start and publish Timing stat, typical use is: stop := metrics.NewTimer("my_metric") defer stop().
NewTimerBySize convenience function start and publish Timing stat bucketed by byte size, typical use is: stop := metrics.NewTimerBySize("my_metric", size) defer stop().
PrecisionTiming calls PrecisionTiming on DefaultStatsd.
Range returns a size range string based on the input size in bytes.
SanitizeRoute cleans up a route for the Gorilla Mux to be used as a metric name.
Statsd returns a ready to use Statsd interface, in case of error connecting to the statsd instance returns a no operation interface, Connection with Statsd is UDP (fire and forget) is recommended to use just one instance, to send all the stats, and call Close when the service stops to.
Timer returns a function which returns an int64 that represents the difference in time between Time being called and the returning function being called in milliseconds.
Timing calls Timing on DefaultStatsd.
Total calls Total on DefaultStatsd.
# Variables
DefaultStatsd is the default statsd implementation.
# Structs
Config contains all the logic for parsing command line flags.
LoggingClient is a client that dumps stats to a Logger.
MultiClient passes metrics to multiple statsd backends.
RecorderResponseWriter is an http.ResponseWriter that keeps track of the http status code.
# Interfaces
Recorder is a convenience interface to record the response codes.
# Type aliases
StopFunc stops the timer started with NewTimer and publishes the result.