Skip to content

Commit

Permalink
mongodb input: fix version 2.2 panic
Browse files Browse the repository at this point in the history
closes #1628
  • Loading branch information
sparrc committed Sep 6, 2016
1 parent 1271f9d commit 1b34444
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/inputs/mongodb/mongostat.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ func NewStatLine(oldMongo, newMongo MongoStatus, key string, all bool, sampleSec
returnVal.Command = diff(newStat.Opcounters.Command, oldStat.Opcounters.Command, sampleSecs)
}

if newStat.Metrics.TTL != nil && oldStat.Metrics.TTL != nil {
if newStat.Metrics != nil && newStat.Metrics.TTL != nil && oldStat.Metrics.TTL != nil {
returnVal.Passes = diff(newStat.Metrics.TTL.Passes, oldStat.Metrics.TTL.Passes, sampleSecs)
returnVal.DeletedDocuments = diff(newStat.Metrics.TTL.DeletedDocuments, oldStat.Metrics.TTL.DeletedDocuments, sampleSecs)
}
Expand Down

0 comments on commit 1b34444

Please sign in to comment.