1package statser 2 3import ( 4 "time" 5 6 "github.com/atlassian/gostatsd" 7) 8 9// Statser is the interface for sending metrics 10type Statser interface { 11 // NotifyFlush is called when a flush occurs. It signals all known subscribers. 12 NotifyFlush(d time.Duration) 13 // RegisterFlush returns a channel which will receive a notification after every flush, and a cleanup 14 // function which should be called to signal the channel is no longer being monitored. If the channel 15 // blocks, the notification will be silently dropped. 16 RegisterFlush() (ch <-chan time.Duration, unregister func()) 17 18 Gauge(name string, value float64, tags gostatsd.Tags) 19 Count(name string, amount float64, tags gostatsd.Tags) 20 Increment(name string, tags gostatsd.Tags) 21 TimingMS(name string, ms float64, tags gostatsd.Tags) 22 TimingDuration(name string, d time.Duration, tags gostatsd.Tags) 23 NewTimer(name string, tags gostatsd.Tags) *Timer 24 WithTags(tags gostatsd.Tags) Statser 25} 26