top
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.
Syntax
The command has the following syntax:
db.runCommand( { top: 1 } )
Example
At mongosh
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 } } }