Launch self-monitoring in a go-routine

pull/1936/head
Philip O'Toole 2015-03-13 16:57:09 -07:00 committed by Philip O'Toole
parent 43161bb5da
commit 032cfaa980
1 changed files with 21 additions and 17 deletions

View File

@ -331,6 +331,7 @@ func (s *Server) StartSelfMonitoring(database, retention string, interval time.D
// Grab the initial stats.
prev := s.stats.Snapshot()
go func() {
for {
time.Sleep(interval)
@ -352,6 +353,9 @@ func (s *Server) StartSelfMonitoring(database, retention string, interval time.D
// Save stats for the next loop.
prev = stats
}
}()
return nil
}
// StartRetentionPolicyEnforcement launches retention policy enforcement.