ntpq: correct number of seconds in an hour

closes #2256
This commit is contained in:
Cameron Sparr 2017-01-24 15:27:44 -08:00
parent c4d4185fb5
commit 168270ea5f
No known key found for this signature in database
GPG Key ID: 19E67263DCB25D0F
2 changed files with 2 additions and 2 deletions

View File

@ -136,7 +136,7 @@ func (n *NTPQ) Gather(acc telegraf.Accumulator) error {
continue
}
// seconds in an hour
mFields[key] = int64(m) * 360
mFields[key] = int64(m) * 3600
continue
case strings.HasSuffix(when, "d"):
m, err := strconv.Atoi(strings.TrimSuffix(fields[index], "d"))

View File

@ -171,7 +171,7 @@ func TestHoursNTPQ(t *testing.T) {
assert.NoError(t, n.Gather(&acc))
fields := map[string]interface{}{
"when": int64(720),
"when": int64(7200),
"poll": int64(256),
"reach": int64(37),
"delay": float64(51.016),