Fix mongodb document stats (#5049)

This commit is contained in:
Daniel Nelson 2018-11-28 16:43:13 -08:00 committed by GitHub
parent db497a04ea
commit 55b798bd20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -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)

View File

@ -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 {