Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Metrics ¶
func Metrics()
Metrics will enable the collection and printing of debug metrics.
Example ¶
Metrics() counter := NewCounter("counter", nil) counter.Add(1) counter.Add(2) timer := NewTimer("timer") timer.Add(time.Millisecond) timer.Add(time.Second) TrackFloat("track", func() float64 { return 2 }) time.Sleep(1500 * time.Millisecond)
Output: counter: 3 c/s | timer: 1ms - 500.5ms - 1s | track: 2.00
func TrackFloat ¶ added in v0.3.0
TrackFloat will track a float over time.
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter is a simple operations counter.
func NewCounter ¶
NewCounter will create and return a counter.
Click to show internal directories.
Click to hide internal directories.