标签:restore ODB 操作 batch scan lock eof 记录 date
> db.getProfilingStatus() { "was" : 0, "slowms" : 100, "sampleRate" : 1 }
可以通过getProfilingStatus来查看当前profile设置
profile分为3个级别
0:表明profile是关闭的,mongodb不会记录任何操作 1:配合slowms做预值,mongodb会记录所有超过slowms的操作 2:mongodb会记录任何操作
> db.setProfilingLevel(2) { "was" : 0, "slowms" : 100, "sampleRate" : 1, "ok" : 1 }
> db.getProfilingLevel() 2
> db.system.profile.find().sort({$natural:-1}).limit(2) { "op" : "query", "ns" : "test.system.profile", "command" : { "find" : "system.profile", "filter" : { }, "limit" : 10, "singleBatch" : false, "sort" : { "$natural" : -1 }, "$db" : "test" }, "keysExamined" : 0, "docsExamined" : 10, "cursorExhausted" : true, "numYield" : 0, "nreturned" : 10, "locks" : { "Global" : { "acquireCount" : { "r" : NumberLong(1) } }, "Database" : { "acquireCount" : { "r" : NumberLong(1) } }, "Collection" : { "acquireCount" : { "r" : NumberLong(1) } } }, "responseLength" : 5140, "protocol" : "op_msg", "millis" : 0, "planSummary" : "COLLSCAN", "execStats" : { "stage" : "LIMIT", "nReturned" : 10, "executionTimeMillisEstimate" : 0, "works" : 12, "advanced" : 10, "needTime" : 1, "needYield" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 1, "invalidates" : 0, "limitAmount" : 10, "inputStage" : { "stage" : "COLLSCAN", "nReturned" : 10, "executionTimeMillisEstimate" : 0, "works" : 11, "advanced" : 10, "needTime" : 1, "needYield" : 0, "saveState" : 0, "restoreState" : 0, "isEOF" : 0, "invalidates" : 0, "direction" : "backward", "docsExamined" : 10 } }, "ts" : ISODate("2018-08-11T23:37:03.517Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], "user" : "" } { "op" : "query", "ns" : "test.system.profile", "command" : { "find" : "system.profile", "filter" : { }, "$db" : "test" }, "cursorid" : 63845545503, "keysExamined" : 0, "docsExamined" : 101, "numYield" : 0, "nreturned" : 101, "locks" : { "Global" : { "acquireCount" : { "r" : NumberLong(1) } }, "Database" : { "acquireCount" : { "r" : NumberLong(1) } }, "Collection" : { "acquireCount" : { "r" : NumberLong(1) } } }, "responseLength" : 44741, "protocol" : "op_msg", "millis" : 0, "planSummary" : "COLLSCAN", "execStats" : { "stage" : "COLLSCAN", "nReturned" : 101, "executionTimeMillisEstimate" : 0, "works" : 102, "advanced" : 101, "needTime" : 1, "needYield" : 0, "saveState" : 1, "restoreState" : 0, "isEOF" : 0, "invalidates" : 0, "direction" : "forward", "docsExamined" : 101 }, "ts" : ISODate("2018-08-11T23:35:25.260Z"), "client" : "127.0.0.1", "appName" : "MongoDB Shell", "allUsers" : [ ], "user" : "" }
标签:restore ODB 操作 batch scan lock eof 记录 date
原文地址:https://www.cnblogs.com/wzndkj/p/9461934.html