fix interval rounding error

closes #1190
This commit is contained in:
Rene Zbinden 2016-05-12 16:20:50 +02:00 committed by Cameron Sparr
parent 4f5d5926d9
commit 4dcb82bf08
1 changed files with 1 additions and 1 deletions

View File

@ -140,7 +140,7 @@ func (s *Sysstat) Gather(acc telegraf.Accumulator) error {
if firstTimestamp.IsZero() {
firstTimestamp = time.Now()
} else {
s.interval = int(time.Since(firstTimestamp).Seconds())
s.interval = int(time.Since(firstTimestamp).Seconds() + 0.5)
}
}
ts := time.Now().Add(time.Duration(s.interval) * time.Second)