Fix global variable collection when using interval_slow option in mysql input (#3500)
This commit is contained in:
parent
7442b5645f
commit
f758d0c6c3
|
@ -588,17 +588,12 @@ func (m *Mysql) gatherServer(serv string, acc telegraf.Accumulator) error {
|
||||||
|
|
||||||
// Global Variables may be gathered less often
|
// Global Variables may be gathered less often
|
||||||
if len(m.IntervalSlow) > 0 {
|
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)
|
err = m.gatherGlobalVariables(db, serv, acc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
lastT = time.Now()
|
lastT = time.Now()
|
||||||
} else {
|
|
||||||
err = m.gatherGlobalVariables(db, serv, acc)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue