top

  • top
  • top is an administrative command thatreturns usage statistics for each collection. topprovides amount of time, in microseconds, used and a count ofoperations for the following event types:

    • total
    • readLock
    • writeLock
    • queries
    • getmore
    • insert
    • update
    • remove
    • commands

Important

The top command must be run against amongod instance. Runningtop against a mongosinstance will return an error.

Issue the top command against the admindatabase in the form:

  1. { top: 1 }

Example

At the mongo shell prompt, use top with thefollowing invocation:

  1. db.adminCommand("top")

Alternately you can use top as follows:

  1. db.adminCommand( { top: 1 } )

The output of the top command would resemble the followingoutput:

  1. {
  2. "totals" : {
  3. "records.users" : {
  4. "total" : {
  5. "time" : 305277,
  6. "count" : 2825
  7. },
  8. "readLock" : {
  9. "time" : 305264,
  10. "count" : 2824
  11. },
  12. "writeLock" : {
  13. "time" : 13,
  14. "count" : 1
  15. },
  16. "queries" : {
  17. "time" : 305264,
  18. "count" : 2824
  19. },
  20. "getmore" : {
  21. "time" : 0,
  22. "count" : 0
  23. },
  24. "insert" : {
  25. "time" : 0,
  26. "count" : 0
  27. },
  28. "update" : {
  29. "time" : 0,
  30. "count" : 0
  31. },
  32. "remove" : {
  33. "time" : 0,
  34. "count" : 0
  35. },
  36. "commands" : {
  37. "time" : 0,
  38. "count" : 0
  39. }
  40. }
  41. }