Skip to content

Commit 700b52d

Browse files
lgosselindanielnelson
authored andcommitted
Fix global variable collection when using interval_slow option in mysql input (#3500)
(cherry picked from commit f758d0c)
1 parent ddcb931 commit 700b52d

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

plugins/inputs/mysql/mysql.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -588,17 +588,12 @@ func (m *Mysql) gatherServer(serv string, acc telegraf.Accumulator) error {
588588

589589
// Global Variables may be gathered less often
590590
if len(m.IntervalSlow) > 0 {
591-
if uint32(time.Since(lastT).Seconds()) > scanIntervalSlow {
591+
if uint32(time.Since(lastT).Seconds()) >= scanIntervalSlow {
592592
err = m.gatherGlobalVariables(db, serv, acc)
593593
if err != nil {
594594
return err
595595
}
596596
lastT = time.Now()
597-
} else {
598-
err = m.gatherGlobalVariables(db, serv, acc)
599-
if err != nil {
600-
return err
601-
}
602597
}
603598
}
604599

0 commit comments

Comments
 (0)