Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Increment ¶
func Increment(key string)
Increment calls the Increment method on the current package-level backend.
func SetBackend ¶
func SetBackend(b Backend)
SetBackend configures the package-global metrics Backend
func WrapC ¶
func WrapC(h goji.Handler) goji.Handler
WrapC wraps a handler to track request counts and response status code counts namespaced by goji Pattern. It will only include patterns that implemnt fmt.Stringer. For example, if a request matches the pattern /foo/:bar and returns a 204 status code, it will increment "foo.:bar.request" and "foo.:bar.response.204".
WrapC is only safe to use once per request. If you have nested muxes, use WrapC in the outer mux and WrapSubmuxC on the inner mux.
func WrapSubmuxC ¶
func WrapSubmuxC(h goji.Handler) goji.Handler
WrapSubmuxC is a helper for using WrapC with nested muxes. It stores the pattern matched in the current mux but does not track any metrics independently. It should be included in every mux except the outer one.