fix: avoid calling sadc with invalid 0 interval (#11140)

This commit is contained in:
Peter (Stig) Edwards 2022-05-19 16:26:29 +01:00 committed by GitHub
parent 7c89a38d11
commit 81b84fb12b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -122,7 +122,7 @@ func (s *Sysstat) collect(tempfile string) error {
collectInterval := s.interval - parseInterval
// If true, interval is not defined yet and Gather is run for the first time.
if collectInterval < 0 {
if collectInterval <= 0 {
collectInterval = 1 // In that case we only collect for 1 second.
}