Skip to content
Snippets Groups Projects
Commit 4dcb82bf authored by Rene Zbinden's avatar Rene Zbinden Committed by Cameron Sparr
Browse files

fix interval rounding error

closes #1190
parent 4f5d5926
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment