mongodb服务整体状态信息:
db.runCommand( { serverStatus: 1 } ) db.serverStatus()
获取mongodb版本信息:
glc-test:SECONDARY> db.runCommand({serverStatus:1}).version 4.0.17-10 glc-test:SECONDARY>
服务已经运行时间(单位为秒):
mongod服务启动后到现在已经存活的秒数:
glc-test:SECONDARY> db.runCommand({serverStatus:1}).uptime 2075 glc-test:SECONDARY>
进程类型(分mongod和mongos两种):
glc-test:SECONDARY> db.runCommand({serverStatus:1}).process mongod glc-test:SECONDARY> #################### mongos> db.runCommand({serverStatus:1}).process mongos mongos>
断言信息:
# 例如我们去查看断言的asserts 其中例如 warning , user 数量的变化,在有明显的某段时间的增量后,就需要对mongodb的日志进行观察,查询了
# asserts: 报告自MongoDB进程启动以来引发的断言数目的文档。虽然断言错误一般不常见,但如果asserts非零,则应检查日志文件以获取更多信息。在许多情况下,这些错误是微不足道的,但值得研究。
# asserts.regular: 自MongoDB进程启动以来引发的常规断言数。检查日志文件以获取有关这些消息的更多信息。
# asserts.warning: 在4.0版中更改, 从MongoDB 4.0开始,该字段返回零0。在早期版本中,该字段返回自MongoDB进程启动以来引发的警告数。
# asserts.msg: 自MongoDB进程启动以来引发的消息断言数。检查日志文件以获取更多信息。
# asserts.user: 自上次MongoDB进程启动以来发生的“用户断言”数。这些是用户可能生成的错误,例如磁盘空间不足或重复密钥。您可以通过修复应用程序或部署问题来阻止这些断言。查看MongoDB日志以获取更多信息。
# asserts.rollovers:自上次MongoDB进程启动以来翻转计数器已翻转的次数。在2^30个断言之后,计数器将翻转为零。使用此值可为asserts数据结构中的其他值提供上下文 。
mongos> db.runCommand({serverStatus:1}).asserts { "regular" : 0, "warning" : 0, "msg" : 0, "user" : 9538, "rollovers" : 0 } mongos>
#################################
glc-test:SECONDARY> db.runCommand({serverStatus:1}).asserts
{ "regular" : 0, "warning" : 0, "msg" : 0, "user" : 48, "rollovers" : 0 }
glc-test:SECONDARY>
页缺失数量:
#extra_info[page_faults]: 页缺失的次数,当性能不佳的时候,页缺失数可能急剧增加。这可能与内存受限和大的数据集合有关,有限且偶发的页面错误不一定表示存在问题
glc-test:SECONDARY> db.runCommand({serverStatus:1}).extra_info.page_faults 7 glc-test:SECONDARY>
连接数信息:
glc-test:SECONDARY> db.runCommand({serverStatus:1}).connections { "current" : 10, "available" : 10230, "totalCreated" : 972, "active" : 1 }
# 当前正在活动的连接数: glc-test:SECONDARY> db.runCommand({serverStatus:1}).connections.active 1
# 当前客户端到数据库服务器的连接数。此数值包括当前的shell会话:
glc-test:SECONDARY> db.runCommand({serverStatus:1}).connections.current 10
# 可用的未使用连接数:
glc-test:SECONDARY> db.runCommand({serverStatus:1}).connections.available 10230
# 累计已经创建过的连接数,此数字包括已关闭的连接:
glc-test:SECONDARY> db.runCommand({serverStatus:1}).connections.totalCreated 982 glc-test:SECONDARY>
全局锁信息:
glc-test:PRIMARY> db.runCommand({serverStatus:1}).globalLock { "totalTime" : NumberLong("6641104292000"), "currentQueue" : { "total" : 3, "readers" : 3, "writers" : 0 }, "activeClients" : { "total" : 59, "readers" : 0, "writers" : 1 } }
==================================
#globalLock.currentQueue.total: 等锁的操作的总数(即,总和globalLock.currentQueue.readers和 globalLock.currentQueue.writers)。
glc-test:PRIMARY> db.runCommand({serverStatus:1}).globalLock.currentQueue.total 3
=====================================
#globalLock.currentQueue.readers: 排队等待读锁的操作数。持续很小的读队列,尤其是较短的操作,不必关注。
glc-test:PRIMARY> db.runCommand({serverStatus:1}).globalLock.currentQueue.readers 3
====================================
#globalLock.currentQueue.writers: 排队等待写锁的操作数。持续很小写队列,特别是较短的操作,不必关注。
glc-test:PRIMARY> db.runCommand({serverStatus:1}).globalLock.currentQueue.writers 0
#######################################################################################
=================================
#globalLock.activeClients.total: 内部客户端连接db总数,包括系统线程以及读写队列。由于包括系统线程,此值将高于activeClients.readers 和activeClients.writers之和。
glc-test:PRIMARY> db.runCommand({serverStatus:1}).globalLock.activeClients.total 59
=================================
#globalLock.activeClients.readers: 执行读操作的活跃客户端连接数。
glc-test:PRIMARY> db.runCommand({serverStatus:1}).globalLock.activeClients.readers 0
==================================
#globalLock.activeClients.writers: 执行写操作的活跃客户端连接数。
glc-test:PRIMARY> db.runCommand({serverStatus:1}).globalLock.activeClients.writers 1 glc-test:PRIMARY>
锁监控信息:
glc-test:PRIMARY> db.runCommand({serverStatus:1}).locks { "Global" : { "acquireCount" : { "r" : NumberLong(268520492), "w" : NumberLong(4012050), "R" : NumberLong(1), "W" : NumberLong(243637) }, "acquireWaitCount" : { "r" : NumberLong(140), "w" : NumberLong(688), "W" : NumberLong(57) }, "timeAcquiringMicros" : { "r" : NumberLong("60903006897"), "w" : NumberLong("6167369228"), "W" : NumberLong(6636) } }, "Database" : { "acquireCount" : { "r" : NumberLong(180952566), "w" : NumberLong(3805130), "R" : NumberLong(8), "W" : NumberLong(216) }, "acquireWaitCount" : { "r" : NumberLong(17), "w" : NumberLong(123), "W" : NumberLong(32) }, "timeAcquiringMicros" : { "r" : NumberLong("11971702698"), "w" : NumberLong("2727138813"), "W" : NumberLong(129081) } }, "Collection" : { "acquireCount" : { "r" : NumberLong(82733356), "w" : NumberLong(3561420), "W" : NumberLong(7) }, "acquireWaitCount" : { "r" : NumberLong(16) }, "timeAcquiringMicros" : { "r" : NumberLong("28236381486") } }, "Metadata" : { "acquireCount" : { "W" : NumberLong(245) }, "acquireWaitCount" : { "W" : NumberLong(117) }, "timeAcquiringMicros" : { "W" : NumberLong(9585) } }, "Mutex" : { "acquireCount" : { "W" : NumberLong(2) } }, "oplog" : { "acquireCount" : { "r" : NumberLong(100101963), "w" : NumberLong(243617), "W" : NumberLong(1) } } } glc-test:PRIMARY>
网络流量信息:
glc-test:PRIMARY> db.runCommand({serverStatus:1}).network { "bytesIn" : NumberLong("151144866398"), "bytesOut" : NumberLong("808195680961"), "physicalBytesIn" : NumberLong("147732715815"), "physicalBytesOut" : NumberLong("636611536772"), "numRequests" : NumberLong(103740653), "compression" : { "snappy" : { "compressor" : { "bytesIn" : NumberLong("268216472216"), "bytesOut" : NumberLong("95172234043") }, "decompressor" : { "bytesIn" : NumberLong("32244871203"), "bytesOut" : NumberLong("38976582101") } } }, "serviceExecutorTaskStats" : { "executor" : "adaptive", "totalQueued" : NumberLong(209366202), "totalExecuted" : NumberLong(209366202), "threadsInUse" : 4, "totalTimeRunningMicros" : NumberLong("107216244178788"), "totalTimeExecutingMicros" : NumberLong("5972553634823"), "totalTimeQueuedMicros" : NumberLong(908878363), "threadsRunning" : 16, "threadsPending" : 0, "threadCreationCauses" : { "stuckThreadsDetected" : NumberLong("7528457633249249205"), "starvation" : NumberLong("7802015030183150985"), "belowReserveMinimum" : NumberLong("7303197360618091898") }, "metricsByTask" : { "processMessage" : { "totalQueued" : NumberLong(103740649), "totalExecuted" : NumberLong(103740649), "totalTimeExecutingMicros" : NumberLong("5967280314479"), "totalTimeQueuedMicros" : NumberLong(40439426) }, "sourceMessage" : { "totalQueued" : NumberLong(103740410), "totalExecuted" : NumberLong(103740410), "totalTimeExecutingMicros" : NumberLong(1107032830), "totalTimeQueuedMicros" : NumberLong(845618144) }, "exhaustMessage" : { "totalQueued" : NumberLong(0), "totalExecuted" : NumberLong(0), "totalTimeExecutingMicros" : NumberLong(0), "totalTimeQueuedMicros" : NumberLong(0) }, "startSession" : { "totalQueued" : NumberLong(1885143), "totalExecuted" : NumberLong(1885143), "totalTimeExecutingMicros" : NumberLong(253285732), "totalTimeQueuedMicros" : NumberLong(22820792) } } } }
====================
# 数据库接受的网络传输字节数,需要计算每秒内的字节数。
glc-test:PRIMARY> db.runCommand({serverStatus:1}).network.bytesIn NumberLong("151144873696")
=====================
# 数据库发送的网络传输字节数,需要计算每秒内的字节数。
glc-test:PRIMARY> db.runCommand({serverStatus:1}).network.bytesOut NumberLong("808195886901")
=====================
# 数据库接收到的请求的总次数,通常需要计算每秒的次数。
glc-test:PRIMARY> db.runCommand({serverStatus:1}).network.numRequests NumberLong(103740729)
glc-test:PRIMARY>
命令执行个数统计:
自mongod最近一次启动实例以来, 按数据库操作类型报告的文档 ,注意:opcounters操作中的数据数据受多文档影响,例如批量插入或多次更新操作,将作为单个操作处理。有关更详细的文档级操作跟踪,请参阅metrics.document 。此外,这些值反映了接收的操作,即使操作不成功也会增加。
glc-test:PRIMARY> db.runCommand({serverStatus:1}).opcounters { "insert" : 153434913, "query" : 263980, "update" : 10306, "delete" : 224, "getmore" : 70066965, "command" : 33180791 }
==================
# 数据库执行的插入操作次数,需要计算每秒次数:
glc-test:PRIMARY> db.runCommand({serverStatus:1}).opcounters.insert 153434913
==================
# 数据库执行的删除操作次数,需要计算每秒次数:
glc-test:PRIMARY> db.runCommand({serverStatus:1}).opcounters.delete 224
==================
# 数据库执行的更新操作次数,需要计算每秒次数:
glc-test:PRIMARY> db.runCommand({serverStatus:1}).opcounters.update 10307
==================
# 数据库执行的查询操作次数,需要计算每秒次数:
glc-test:PRIMARY> db.runCommand({serverStatus:1}).opcounters.query 263984
==================
# 数据库执行的命令操作次数,需要计算每秒次数:
glc-test:PRIMARY> db.runCommand({serverStatus:1}).opcounters.command 33181236
==================
# 数据库执行的getmore操作次数,需要计算每秒次数:
glc-test:PRIMARY> db.runCommand({serverStatus:1}).opcounters.getmore 70067033
glc-test:PRIMARY>
opcounters.insert:自上次启动mongod实例以来,收到的插入操作总数 。
opcounters.query: 自上次启动mongod实例以来,收到的查询操作总数。
opcounters.update:自上次启动mongod实例以来,收到的更新操作总数 。
opcounters.delete:自上次启动mongod实例以来,收到的删除操作总数。
opcounters.getmore:自上次启动mongod实例以来,“getmore”操作的总数。即使查询数目较低,此计数器也可能很高。作为复制进程的一部分,Secondary节点将发送getMore操作
opcounters.command:自mongod上次启动实例以来,向数据库发出的命令总数,需要排除增删改命令 。
文档增删改返回数量统计:
glc-test:PRIMARY> db.serverStatus().metrics.document { "deleted" : NumberLong(51), "inserted" : NumberLong(153434902), "returned" : NumberLong(834010010), "updated" : NumberLong(10217) }
=================
glc-test:PRIMARY> db.serverStatus().metrics.document.inserted NumberLong(153434902)
=================
glc-test:PRIMARY> db.serverStatus().metrics.document.deleted NumberLong(51)
=================
glc-test:PRIMARY> db.serverStatus().metrics.document.updated NumberLong(10218)
=================
glc-test:PRIMARY> db.serverStatus().metrics.document.returned NumberLong(834010038)
因复制操作的统计:
glc-test:PRIMARY> db.runCommand({serverStatus:1}).opcountersRepl { "insert" : 19, "query" : 0, "update" : 19, "delete" : 18, "getmore" : 0, "command" : 1 }
=================
glc-test:PRIMARY> db.runCommand({serverStatus:1}).opcountersRepl.insert 19
==================
glc-test:PRIMARY> db.runCommand({serverStatus:1}).opcountersRepl.delete 18
==================
glc-test:PRIMARY> db.runCommand({serverStatus:1}).opcountersRepl.update 19
===================
glc-test:PRIMARY> db.runCommand({serverStatus:1}).opcountersRepl.query 0
=================
glc-test:PRIMARY> db.runCommand({serverStatus:1}).opcountersRepl.command 1
==================
glc-test:PRIMARY> db.runCommand({serverStatus:1}).opcountersRepl.getmore 0
glc-test:PRIMARY>
====================
opcountersRepl:自上次启动mongod实例以来按类型报告数据库复制操作的文档。当前主机是副本集的成员时才会显示这些值。
MongoDB在复制期间序列化操作,因此这些值将与opcounters值不同。更多信息请参阅复制。这些数字将随着时间的推移而增长,以响应数据库使用,直到下次重启。随着时间的推移分析这些值以跟踪数据库利用率。
opcountersRepl.insert:自上次启动mongod实例以来复制插入操作的总数 。
opcountersRepl.query:自 上次启动mongod实例以来复制查询的总数。
opcountersRepl.update:自上次启动mongod实例以来复制更新操作总数 。
opcountersRepl.delete:自上次启动mongod实例以来复制的删除操作总数 。
opcountersRepl.getmore:自上次启动mongod实例以来“getmore”操作的总数。即使查询数目较低,此计数器也可能很高。作为复制进程的一部分,secondary节点发送getMore操作。
opcountersRepl.command:自上次启动mongod实例以来发送到数据库的复制命令总数。
####################################################################
注意!!!!:仅当当前主机是副本集的成员时,才会显示这些值。
mongodb内存使用统计:
glc-test:PRIMARY> db.runCommand({serverStatus:1}).mem { "bits" : 64, "resident" : 4310, "virtual" : 6269, "supported" : true, "mapped" : 0, "mappedWithJournal" : 0 }
==================
glc-test:PRIMARY> db.runCommand({serverStatus:1}).mem.resident 4304
==================
glc-test:PRIMARY> db.runCommand({serverStatus:1}).mem.virtual 6269mem.resident
大致等于mongod进程当前使用的RAM量(以兆字节(MiB)为单位)。在正常使用期间,该值趋于增加。在专用数据库服务器中,此数字趋向于接近系统内存总量。
mem.virtual
显示mongod
进程使用的虚拟内存量(以兆字节(MiB)为单位)。
实例角色确认:
glc-test:PRIMARY> db.runCommand({serverStatus:1}).repl { "hosts" : [ "c3-dba-glc-db03.bj:28042", "c4-mc-buffer-db41.bj:28042", "c4-using-glc-db05.bj:28042" ], "setName" : "glc-test", "setVersion" : 3, "ismaster" : true, "secondary" : false, "primary" : "c4-mc-buffer-db41.bj:28042", "me" : "c4-mc-buffer-db41.bj:28042", "electionId" : ObjectId("7fffffff0000000000000073"), "lastWrite" : { "opTime" : { "ts" : Timestamp(1605252345, 1), "t" : NumberLong(115) }, "lastWriteDate" : ISODate("2020-11-13T07:25:45Z"), "majorityOpTime" : { "ts" : Timestamp(1605252345, 1), "t" : NumberLong(115) }, "majorityWriteDate" : ISODate("2020-11-13T07:25:45Z") }, "rbid" : 1 } glc-test:PRIMARY> db.runCommand({serverStatus:1}).repl.ismaster true glc-test:PRIMARY> db.runCommand({serverStatus:1}).repl.secondary false glc-test:PRIMARY> db.runCommand({serverStatus:1}).repl.setName glc-test
########################################################################
若db.runCommand({serverStatus:1}).repl.ismaster = true ,则为primary角色;
若db.runCommand({serverStatus:1}).repl.secondary = true,则为secondary角色;
若db.runCommand({serverStatus:1}).repl.secondary = false,且 db.runCommand({serverStatus:1}).repl.ismaster = false ,且db.runCommand({serverStatus:1}).repl.setName 不为false,则为secondary角色
否则为standalone角色:
wiredTiger缓存统计信息:
glc-test:PRIMARY> db.runCommand({serverStatus:1}).wiredTiger.cache { "application threads page read from disk to cache count" : 48718926, "application threads page read from disk to cache time (usecs)" : 2514482076, "application threads page write from cache to disk count" : 1990467, "application threads page write from cache to disk time (usecs)" : 64791253, "bytes belonging to page images in the cache" : 2477045336, "bytes belonging to the cache overflow table in the cache" : 182, "bytes currently in the cache" : 3435228132, ---------------------------------->> wiredTiger cache的字节数,当前在缓存中的数据的字节大小。该值不应大于最大缓存大小。 "bytes dirty in the cache cumulative" : 312694322946,--------------------------->> wiredTiger cache中"dirty"数据的字节数,缓存中脏数据的大小(以字节为单位)。该值应小于 bytes currently in the cache。 "bytes not belonging to page images in the cache" : 958182795, "bytes read into cache" : NumberLong("7731788908256348"),----------------------->> 数据库写入wiredTiger cache的字节数,需要计算每秒字节数。 "bytes written from cache" : 277403867305,-------------------------------------->> 数据库从wiredTiger cache写入到磁盘的字节数,需要计算每秒字节数。 "cache overflow cursor application thread wait time (usecs)" : 0, "cache overflow cursor internal thread wait time (usecs)" : 0, "cache overflow score" : 0, "cache overflow table entries" : 0, "cache overflow table insert calls" : 0, "cache overflow table max on-disk size" : 0, "cache overflow table on-disk size" : 0, "cache overflow table remove calls" : 0, "checkpoint blocked page eviction" : 54, "eviction calls to get a page" : 55036280, "eviction calls to get a page found queue empty" : 484223, "eviction calls to get a page found queue empty after locking" : 543347, "eviction currently operating in aggressive mode" : 0, "eviction empty score" : 0, "eviction passes of a file" : 2799546, "eviction server candidate queue empty when topping up" : 320638, "eviction server candidate queue not empty when topping up" : 291565, "eviction server evicting pages" : 0, "eviction server slept, because we did not make progress with eviction" : 2961658, "eviction server unable to reach eviction goal" : 0, "eviction server waiting for a leaf page" : 1507000170, "eviction server waiting for an internal page sleep (usec)" : 0, "eviction server waiting for an internal page yields" : 100, "eviction state" : 128, "eviction walk target pages histogram - 0-9" : 1848324, "eviction walk target pages histogram - 10-31" : 266882, "eviction walk target pages histogram - 128 and higher" : 0, "eviction walk target pages histogram - 32-63" : 185330, "eviction walk target pages histogram - 64-128" : 499010, "eviction walk target strategy both clean and dirty pages" : 196870, "eviction walk target strategy only clean pages" : 2580530, "eviction walk target strategy only dirty pages" : 22146, "eviction walks abandoned" : 199618, "eviction walks gave up because they restarted their walk twice" : 1161121, "eviction walks gave up because they saw too many pages and found no candidates" : 634488, "eviction walks gave up because they saw too many pages and found too few candidates" : 5235, "eviction walks reached end of tree" : 2947891, "eviction walks started from root of tree" : 1896637, "eviction walks started from saved location in tree" : 902909, "eviction worker thread active" : 4, "eviction worker thread created" : 0, "eviction worker thread evicting pages" : 54001065, "eviction worker thread removed" : 0, "eviction worker thread stable number" : 0, "files with active eviction walks" : 0, "files with new eviction walks started" : 1786770, "force re-tuning of eviction workers once in a while" : 0, "forced eviction - pages evicted that were clean count" : 2645046, "forced eviction - pages evicted that were clean time (usecs)" : 2748172, "forced eviction - pages evicted that were dirty count" : 1, "forced eviction - pages evicted that were dirty time (usecs)" : 40, "forced eviction - pages selected because of too many deleted items count" : 2809, "forced eviction - pages selected count" : 2702464, "forced eviction - pages selected unable to be evicted count" : 22321, "forced eviction - pages selected unable to be evicted time" : 36567, "hazard pointer blocked page eviction" : 5815, "hazard pointer check calls" : 56708452, "hazard pointer check entries walked" : 344900361, "hazard pointer maximum array length" : 2, "in-memory page passed criteria to be split" : 113326, "in-memory page splits" : 35100, "internal pages evicted" : 478489, "internal pages queued for eviction" : 466169, "internal pages seen by eviction walk" : 22350674, "internal pages seen by eviction walk that are already queued" : 137555, "internal pages split during eviction" : 849, "leaf pages split during eviction" : 39843, "maximum bytes configured" : 4294967296,---------------------------------------->> 这个是mongodb数据库的mongodb.conf配置文件中配置的cacheSizeGB大小,最大缓存大小,相当于mysql的缓冲池大小。 "maximum page size at eviction" : 0, "modified pages evicted" : 215182, "modified pages evicted by application threads" : 0, "operations timed out waiting for space in cache" : 0, "overflow pages read into cache" : 0, "page split during eviction deepened the tree" : 20, "page written requiring cache overflow records" : 0, "pages currently held in the cache" : 138974, "pages evicted by application threads" : 0, "pages queued for eviction" : 59889728, "pages queued for eviction post lru sorting" : 60355154, "pages queued for urgent eviction" : 56076, "pages queued for urgent eviction during walk" : 8035, "pages read into cache" : 48719134, "pages read into cache after truncate" : 442, "pages read into cache after truncate in prepare state" : 0, "pages read into cache requiring cache overflow entries" : 0, "pages read into cache requiring cache overflow for checkpoint" : 0, "pages read into cache skipping older cache overflow entries" : 0, "pages read into cache with skipped cache overflow entries needed later" : 0, "pages read into cache with skipped cache overflow entries needed later by checkpoint" : 0, "pages requested from the cache" : 1154239659, "pages seen by eviction walk" : 90248892, "pages seen by eviction walk that are already queued" : 4615085, "pages selected for eviction unable to be evicted" : 29178, "pages selected for eviction unable to be evicted as the parent page has overflow items" : 0, "pages selected for eviction unable to be evicted because of active children on an internal page" : 4274, "pages selected for eviction unable to be evicted because of failure in reconciliation" : 0, "pages selected for eviction unable to be evicted due to newer modifications on a clean page" : 0, "pages walked for eviction" : 3450449135, "pages written from cache" : 11082806, "pages written requiring in-memory restoration" : 5736, "percentage overhead" : 8, "tracked bytes belonging to internal pages in the cache" : 107003774, "tracked bytes belonging to leaf pages in the cache" : 3328224358, "tracked dirty bytes in the cache" : 2324125, "tracked dirty pages in the cache" : 4, "unmodified pages evicted" : 56381596 }
wiredTiger事务统计信息:
glc-test:PRIMARY> db.runCommand({serverStatus:1}).wiredTiger.concurrentTransactions { "write" : { "out" : 0, "available" : 128, "totalTickets" : 128 }, "read" : { "out" : 1, "available" : 127, "totalTickets" : 128 } }
glc-test:PRIMARY> db.runCommand({serverStatus:1}).wiredTiger.concurrentTransactions.write.available 128
glc-test:PRIMARY> db.runCommand({serverStatus:1}).wiredTiger.concurrentTransactions.read.available 127
wiredTiger的block-manager统计信息:
"block-manager" : { "blocks pre-loaded" : 3236, "blocks read" : 49028852, "blocks written" : 11704040, "bytes read" : 530830061568, "bytes written" : 119824228352, "bytes written for checkpoint" : 12477071360, "mapped blocks read" : 0, "mapped bytes read" : 0
oplog统计信息:
glc-test:PRIMARY> db.runCommand({serverStatus:1}).metrics.repl { "executor" : { "pool" : { "inProgressCount" : 0 }, "queues" : { "networkInProgress" : 0, "sleepers" : 3 }, "unsignaledEvents" : 0, "shuttingDown" : false, "networkInterface" : "DEPRECATED: getDiagnosticString is deprecated in NetworkInterfaceTL" }, "apply" : { "attemptsToBecomeSecondary" : NumberLong(1), "batchSize" : NumberLong(243804), "batches" : { "num" : 243613, "totalMillis" : 411 }, "ops" : NumberLong(243804) }, "buffer" : { "count" : NumberLong(0), "maxSizeBytes" : NumberLong(268435456), "sizeBytes" : NumberLong(0) }, "initialSync" : { "completed" : NumberLong(1), "failedAttempts" : NumberLong(0), "failures" : NumberLong(0) }, "network" : { "bytes" : NumberLong(26827062), "getmores" : { "num" : 731518, "totalMillis" : 2437415427 }, "ops" : NumberLong(243814), "readersCreated" : NumberLong(12) }, "preload" : { "docs" : { "num" : 0, "totalMillis" : 0 }, "indexes" : { "num" : 0, "totalMillis" : 0 } } }
=================
glc-test:PRIMARY> db.runCommand({serverStatus:1}).metrics.repl.apply.batches.num 243613
=================
glc-test:PRIMARY> db.runCommand({serverStatus:1}).metrics.repl.apply.batches.totalMillis 411
==================
glc-test:PRIMARY> db.runCommand({serverStatus:1}).metrics.repl.apply.ops NumberLong(243804)
==================
glc-test:PRIMARY> db.runCommand({serverStatus:1}).metrics.repl.buffer.count NumberLong(0)
==================
glc-test:PRIMARY> db.runCommand({serverStatus:1}).metrics.repl.buffer.sizeBytes NumberLong(0)
游标统计信息:
glc-test:PRIMARY> db.runCommand({serverStatus:1}).metrics.cursor { "timedOut" : NumberLong(22), "open" : { "noTimeout" : NumberLong(0), "pinned" : NumberLong(1), "total" : NumberLong(1) } }
===================
glc-test:PRIMARY> db.runCommand({serverStatus:1}).metrics.cursor.timedOut NumberLong(22)
=================
glc-test:PRIMARY> db.runCommand({serverStatus:1}).metrics.cursor.open.noTimeout NumberLong(0)
=================
glc-test:PRIMARY> db.runCommand({serverStatus:1}).metrics.cursor.open.pinned NumberLong(1)
=================
glc-test:PRIMARY> db.runCommand({serverStatus:1}).metrics.cursor.open.total NumberLong(1)
##############################################