Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion metrics/opentsdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ func OpenTSDB(r Registry, d time.Duration, prefix string, addr *net.TCPAddr) {
// OpenTSDBWithConfig is a blocking exporter function just like OpenTSDB,
// but it takes a OpenTSDBConfig instead.
func OpenTSDBWithConfig(c OpenTSDBConfig) {
for range time.Tick(c.FlushInterval) {
ticker := time.NewTicker(c.FlushInterval)
defer ticker.Stop() // Use NewTicker to allow explicit stop and avoid leaked timers.
for range ticker.C {
if err := openTSDB(&c); nil != err {
log.Println(err)
}
Expand Down