Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateStatsdClient ¶
CreateStatsdClient creates a local instances of a statsd client. Any errors will be logged to console and ignored.
func Handler ¶
func Handler(res http.ResponseWriter, req *http.Request)
Handler display a JSON object showing number of requests received Copied from https://golang.org/src/expvar/expvar.go#L305
func ShutdownStatsdClient ¶
func ShutdownStatsdClient()
ShutdownStatsdClient flushes any outstanding stats and terminates connections to statsd.
Types ¶
type Stat ¶
type Stat struct {
// contains filtered or unexported fields
}
Stat holds a named integer counter, which is exported to expvar and statsd
type TimingStat ¶
type TimingStat struct {
// contains filtered or unexported fields
}
TimingStat holds a timer statistic, internally represented as two counters, total time consumed and number of observations.
func NewTimingStat ¶
func NewTimingStat(key string) *TimingStat
NewTimingStat creates a timing statistic with the given name
func (*TimingStat) Add ¶
func (ts *TimingStat) Add(delta time.Duration)
Add notes a timing event of given duration (increases observation count by one and adds time duration to total time spent in event)
func (*TimingStat) AddTimeSince ¶
func (ts *TimingStat) AddTimeSince(start time.Time)
AddTimeSince calculates time elapsed since given start time and adds it to the stat.