Fix global variable collection when using interval_slow option in mysql input (#3500)

(cherry picked from commit f758d0c6c3)
This commit is contained in:
Laurent Gosselin 2017-11-27 21:29:51 +01:00 committed by Daniel Nelson
parent ddcb93188f
commit 700b52dbd1
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
1 changed files with 1 additions and 6 deletions

View File

@ -588,17 +588,12 @@ func (m *Mysql) gatherServer(serv string, acc telegraf.Accumulator) error {
// Global Variables may be gathered less often
if len(m.IntervalSlow) > 0 {
if uint32(time.Since(lastT).Seconds()) > scanIntervalSlow {
if uint32(time.Since(lastT).Seconds()) >= scanIntervalSlow {
err = m.gatherGlobalVariables(db, serv, acc)
if err != nil {
return err
}
lastT = time.Now()
} else {
err = m.gatherGlobalVariables(db, serv, acc)
if err != nil {
return err
}
}
}