statsd

package module
v0.0.0-...-d75044b Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2016 License: MIT Imports: 5 Imported by: 0

README

Statsd Middleware for Go-Json-Rest

Currently not used in production, API subject to change

godoc license

This is a middleware for Go-Json-Rest. It uses g2s to send statistics about the current request/response to a statsd server. It depends on rest.TimerMiddleware and rest.RecorderMiddleware that should be in the wrapped middlewares.

The two metrics are in the form:

  • [<Prefix>.]response.status_code.<StatusCode>: Counter.
  • [<Prefix>.]response.elasped_time: Timer.

Copyright (c) 2015-2016 Antoine Imbert

MIT License

Analytics

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StatsdMiddleware

type StatsdMiddleware struct {

	// IP and port of the statsd server. Optional. Default to "127.0.0.1:8125".
	IpPort string

	// Prefix added to the metric keys. Optional.
	Prefix string
}

StatsdMiddleware is a Go-Json-Rest Middleware. It sends statistic about the current request/response to a statsd server. It depends on rest.TimerMiddleware and rest.RecorderMiddleware that should be in the wrapped middlewares. The two metrics are in the form: "[<Prefix>.]response.status_code.<StatusCode>": Counter. "[<Prefix>.]response.elasped_time": Timer.

func (*StatsdMiddleware) MiddlewareFunc

func (mw *StatsdMiddleware) MiddlewareFunc(handler rest.HandlerFunc) rest.HandlerFunc

MiddlewareFunc makes StatsdMiddleware implement the rest.Middleware interface.

Jump to

Keyboard shortcuts

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