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") counter.Add(1) counter.Add(2) timer := NewTimer("timer") timer.Add(time.Millisecond) timer.Add(time.Second) Track("track", func() float64 { return 2 }) time.Sleep(1500 * time.Millisecond)
Output: counter: 3.00 c/s | timer: 1ms - 500.5ms - 1s | track: 2.00
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.