diff --git a/plugins/mongodb/mongostat.go b/plugins/mongodb/mongostat.go index 585512d88..891622bd8 100644 --- a/plugins/mongodb/mongostat.go +++ b/plugins/mongodb/mongostat.go @@ -368,7 +368,7 @@ func computeLockDiffs(prevLocks, curLocks map[string]LockUsage) []LockUsage { func diff(newVal, oldVal, sampleTime int64) int64 { d := newVal - oldVal - if d <= 0 { + if d < 0 { d = newVal } return d / sampleTime