top
On this page
This version of the documentation is archived and no longer
supported. View the current documentation to learn how to
upgrade your version of MongoDB.
top
top
is an administrative command that returns usage statistics for each collection.top
provides amount of time, in microseconds, used and a count of operations for the following event types:total
readLock
writeLock
queries
getmore
insert
update
remove
commands
Important
Issue the
top
command against the admin database in the form:{ top: 1 }
Example
At the mongo
shell prompt, use top
with the
following invocation:
db.adminCommand("top")
Alternately you can use top
as follows:
db.adminCommand( { top: 1 } )
The output of the top command would resemble the following output:
{ "totals" : { "records.users" : { "total" : { "time" : 305277, "count" : 2825 }, "readLock" : { "time" : 305264, "count" : 2824 }, "writeLock" : { "time" : 13, "count" : 1 }, "queries" : { "time" : 305264, "count" : 2824 }, "getmore" : { "time" : 0, "count" : 0 }, "insert" : { "time" : 0, "count" : 0 }, "update" : { "time" : 0, "count" : 0 }, "remove" : { "time" : 0, "count" : 0 }, "commands" : { "time" : 0, "count" : 0 } } }