diff --git a/CHANGELOG.md b/CHANGELOG.md index fa7f9607a..34002f238 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ### Bugfixes - [#506](https://github.com/influxdb/telegraf/pull/506): Ping input doesn't return response time metric when timeout. Thanks @titilambert! - [#508](https://github.com/influxdb/telegraf/pull/508): Fix prometheus cardinality issue with the `net` plugin +- [#396](https://github.com/influxdata/telegraf/issues/396): Mongostat diff bug fix ## v0.10.0 [2016-01-12] diff --git a/plugins/inputs/mongodb/mongostat.go b/plugins/inputs/mongodb/mongostat.go index e12d797d0..a6ec4cd10 100644 --- a/plugins/inputs/mongodb/mongostat.go +++ b/plugins/inputs/mongodb/mongostat.go @@ -390,7 +390,7 @@ func computeLockDiffs(prevLocks, curLocks map[string]LockUsage) []LockUsage { func diff(newVal, oldVal, sampleTime int64) int64 { d := newVal - oldVal if d < 0 { - d = newVal + d = maxVal - oldVal + newVal } return d / sampleTime }