From 700b52dbd1233f463a8a5de45e417e4e0e63b3f0 Mon Sep 17 00:00:00 2001 From: Laurent Gosselin Date: Mon, 27 Nov 2017 21:29:51 +0100 Subject: [PATCH] Fix global variable collection when using interval_slow option in mysql input (#3500) (cherry picked from commit f758d0c6c3c291b50cbdc6c82fdb38d31bb41f93) --- plugins/inputs/mysql/mysql.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/plugins/inputs/mysql/mysql.go b/plugins/inputs/mysql/mysql.go index d8ca153d05306..c3dc38423a7fa 100644 --- a/plugins/inputs/mysql/mysql.go +++ b/plugins/inputs/mysql/mysql.go @@ -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 - } } }