Skip to content

Commit

Permalink
Use a time.Ticker object for precise self-monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
otoolep committed Mar 15, 2015
1 parent eec2cf6 commit 69530b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,9 @@ func (s *Server) StartSelfMonitoring(database, retention string, interval time.D
}

go func() {
tick := time.NewTicker(interval)
for {
time.Sleep(interval)
<-tick.C

// Create the data point and write it.
point := Point{
Expand Down

0 comments on commit 69530b7

Please sign in to comment.