Documentation ¶
Overview ¶
* * GoStats * A simple stats server for Go services * * (c)2013 Green Man Gaming Limited *
Index ¶
- Variables
- type StatServe
- func (s *StatServe) FetchStatsFunc() http.HandlerFunc
- func (s *StatServe) IncrementCounter(name string)
- func (s *StatServe) Label(name string, value string)
- func (s *StatServe) ListenAndServe() (e error)
- func (s *StatServe) ResetCounter(name string)
- func (s *StatServe) ResetMetric(name string)
- func (s *StatServe) Time(name string, f func())
Constants ¶
This section is empty.
Variables ¶
View Source
var Stats = &StatServe{ counters: make(map[string]int), metrics: make(map[string]*metric), labels: make(map[string]string), }
A default Stats singleton for us
Functions ¶
This section is empty.
Types ¶
type StatServe ¶
type StatServe struct { Addr string // contains filtered or unexported fields }
func (*StatServe) FetchStatsFunc ¶
func (s *StatServe) FetchStatsFunc() http.HandlerFunc
func (*StatServe) IncrementCounter ¶
* Increment a named counter. We create if it doesn't exist. We also mutex * updates. It's best to call this as a goroutine so that you can fire/forget
func (*StatServe) ListenAndServe ¶
ListenAndServe the Http server - best to use this is as a 'goroutine' as this will allow you to run this in the background
func (*StatServe) ResetCounter ¶
* ResetCounter deletes a counter.
func (*StatServe) ResetMetric ¶
* ResetMetric deletes a metric entry.
Click to show internal directories.
Click to hide internal directories.