mongotop用来跟踪MongoDB的实例, 提供每个集合的统计数据。默认情况下,mongotop每一秒刷新一次。
mongotop用法:
C:\Users\duansf>mongotop --help
View live MongoDB collection statistics.
Options:
--help produce help message
-v [ --verbose ] be more verbose (include multiple times
for more verbosity e.g. -vvvvv)
--quiet silence all non error diagnostic
messages
--version print the program's version and exit
-h [ --host ] arg mongo host to connect to (
--port arg server port. Can also use --host
hostname:port
--ipv6 enable IPv6 support (disabled by
default)
-u [ --username ] arg username
-p [ --password ] arg password
--authenticationDatabase arg user source (defaults to dbname)
--authenticationMechanism arg (=MONGODB-CR)
authentication mechanism
--gssapiServiceName arg (=mongodb) Service name to use when authenticating
using GSSAPI/Kerberos
--gssapiHostName arg Remote host name to use for purpose of
GSSAPI/Kerberos authentication
--locks use db lock info instead of top
C:\Users\duansf>mongotop -h localhost -vvvvv
2016-03-31T17:39:27.553+0800 creating new connection to:localhost:27017
2016-03-31T17:39:27.562+0800 [ConnectBG] BackgroundJob starting: ConnectBG
2016-03-31T17:39:27.565+0800 connected to server localhost:27017 (127.0.0.1)
2016-03-31T17:39:27.565+0800 connected connection!
connected to: localhost
ns total read write
2016-03-31T09:39:28
wangshuai.test 0ms 0ms 0ms
wangshuai.system.namespaces 0ms 0ms 0ms
wangshuai.system.indexes 0ms 0ms 0ms
test.users 0ms 0ms 0ms
test.system.namespaces 0ms 0ms 0ms
test.system.indexes 0ms 0ms 0ms
test.chenfeng 0ms 0ms 0ms
test.books 0ms 0ms 0ms
ns total read write
2016-03-31T09:39:29
wangshuai.test 0ms 0ms 0ms
wangshuai.system.namespaces 0ms 0ms 0ms
wangshuai.system.indexes 0ms 0ms 0ms
test.users 0ms 0ms 0ms
test.system.namespaces 0ms 0ms 0ms
test.system.indexes 0ms 0ms 0ms
test.chenfeng 0ms 0ms 0ms
test.books 0ms 0ms 0ms
ns total read write
2016-03-31T09:39:30
wangshuai.test 0ms 0ms 0ms
wangshuai.system.namespaces 0ms 0ms 0ms
wangshuai.system.indexes 0ms 0ms 0ms
test.users 0ms 0ms 0ms
test.system.namespaces 0ms 0ms 0ms
test.system.indexes 0ms 0ms 0ms
test.chenfeng 0ms 0ms 0ms
test.books 0ms 0ms 0ms
ns total read write
2016-03-31T09:39:31
wangshuai.test 0ms 0ms 0ms
wangshuai.system.namespaces 0ms 0ms 0ms
wangshuai.system.indexes 0ms 0ms 0ms
test.users 0ms 0ms 0ms
test.system.namespaces 0ms 0ms 0ms
test.system.indexes 0ms 0ms 0ms
test.chenfeng 0ms 0ms 0ms
test.books 0ms 0ms 0ms
ns total read write
2016-03-31T09:39:32
wangshuai.test 0ms 0ms 0ms
wangshuai.system.namespaces 0ms 0ms 0ms
wangshuai.system.indexes 0ms 0ms 0ms
test.users 0ms 0ms 0ms
test.system.namespaces 0ms 0ms 0ms
test.system.indexes 0ms 0ms 0ms
test.chenfeng 0ms 0ms 0ms
test.books 0ms 0ms 0ms
输出字段说明:
ns:数据库命名空间,后者结合了数据库名称和集合。
db:数据库的名称。名为 . 的数据库针对全局锁定,而非特定数据库。
total:mongod在这个命令空间上花费的总时间。
read:在这个命令空间上mongod执行读操作花费的时间。
write:在这个命名空间上mongod进行写操作花费的时间。