Documentation ¶
Overview ¶
Package metrics implements simple general counter-metrics. Metrics are enabled by default. If you want to disable metrics, build with: go build -tags disablemetrics
Index ¶
- Constants
- func AddToMaps(key string, value int64, maps ...Map)
- func HttpHandler(rw http.ResponseWriter, r *http.Request)
- func LogOnDebugLevel()
- func RegisterInterval(ctx context.Context, m Map, td time.Duration, reset func(Map, time.Time), ...)
- func SetAverage(m Map, key string, totalVar, casesVar expvar.Var, scale int64, ...)
- func SetRate(m Map, key string, value expvar.Var, timeframe, unit time.Duration)
- type Int
- type Map
- type NS
- type Time
Constants ¶
View Source
const ( DefaultAverageLatencyJSONValue = "\"\"" MilliPerNano = 1000000 )
Variables ¶
This section is empty.
Functions ¶
func HttpHandler ¶
func HttpHandler(rw http.ResponseWriter, r *http.Request)
HttpHandler is a HTTP handler writing the current metrics to the http.ResponseWriter
func LogOnDebugLevel ¶
func LogOnDebugLevel()
LogOnDebugLevel logs all the current metrics, if logging is on Debug level.
func RegisterInterval ¶
func SetAverage ¶
Types ¶
type Int ¶
Int is an interface for some of the operations defined on expvar.Int
type Map ¶
type Map interface { Init() *expvar.Map Get(key string) expvar.Var Set(key string, av expvar.Var) Add(key string, delta int64) }
Map is an interface for some of the operations defined on expvar.Map
Source Files ¶
Click to show internal directories.
Click to hide internal directories.