Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
Fix mongodb document stats (influxdata#5049)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnelson authored Nov 29, 2018
1 parent db497a0 commit 55b798b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugins/inputs/mongodb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,18 @@ Error in input [mongodb]: not authorized on admin to execute command { serverSta
- active_reads (integer)
- active_writes (integer)
- commands_per_sec (integer)
- connections_current (integer)
- connections_available (integer)
- connections_total_created (integer)
- cursor_timed_out (integer)
- cursor_no_timeout (integer)
- cursor_pinned (integer)
- cursor_total (integer)
- deletes_per_sec (integer)
- document_deleted (integer)
- document_inserted (integer)
- document_returned (integer)
- document_updated (integer)
- flushes_per_sec (integer)
- getmores_per_sec (integer)
- inserts_per_sec (integer)
Expand Down
6 changes: 6 additions & 0 deletions plugins/inputs/mongodb/mongostat.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,12 @@ func NewStatLine(oldMongo, newMongo MongoStatus, key string, all bool, sampleSec
returnVal.TotalC = diff(newStat.Metrics.Cursor.Open.Total, oldStat.Metrics.Cursor.Open.Total, sampleSecs)
}
}
if newStat.Metrics.Document != nil {
returnVal.DeletedD = newStat.Metrics.Document.Deleted
returnVal.InsertedD = newStat.Metrics.Document.Inserted
returnVal.ReturnedD = newStat.Metrics.Document.Returned
returnVal.UpdatedD = newStat.Metrics.Document.Updated
}
}

if newStat.OpcountersRepl != nil && oldStat.OpcountersRepl != nil {
Expand Down

0 comments on commit 55b798b

Please sign in to comment.