Meaning of Mongo slow log field

Time:2021-10-19
  1. View the slow log configuration of the current cluster
    db.getProfilingStatus(); // If slowms: indicates the time of slow log configuration
    db.getProfilingLevel(); // Indicates whether to write the slow log to the system table db.system.profile. 0 means off, 1 means on.
  2. Lock mode of Mongo
    Mode Description
    R representatives shared (s) lock. / / shared
    W representatives exclusive (x) lock. / / exclusive
    r Represents Intent Shared (IS) lock.
    w Represents Intent Exclusive (IX) lock.
  3. Meaning of Mongo slow log

    2021-08-13T23:52:53.546+0800 I  COMMAND  [conn125972] command wisteria_assets.cmcc_detect_abnormallogin command: aggregate { aggregate: "cmcc_detect_abnormallogin", pipeline: [ { $match: { abnormal: 1, loginTime: { $gte: 1628784000, $lte: 1628869500 } } } ], allowDiskUse: true, fromMongos: true, cursor: { batchSize: 2147483647 }, useNewUpsert: true, shardVersion: [ Timestamp(0, 0), ObjectId('000000000000000000000000') ], $clusterTime: { clusterTime: Timestamp(1628869497, 1), signature: { hash: BinData(0, C001936257A29DCD858A0256B8540A51EE813919), keyId: 6958721217163427843 } }, $audit: { $impersonatedUsers: [ { user: "qingteng", db: "admin" } ], $impersonatedRoles: [ { role: "root", db: "admin" } ] }, $client: { driver: { name: "mongo-java-driver", version: "3.4.3-dirty" }, os: { type: "Linux", name: "Linux", architecture: "amd64", version: "3.10.0-957HG.el7.x86_64" }, platform: "Java/Oracle Corporation/1.8.0_172-b11", mongos: { host: "WXJD-PSC-P9F1-SPOD2-VM-OS01-BCSAFEBOX-CSCENTER19:27017", client: "10.175.218.65:41057", version: "4.2.10" } }, $configServerState: { opTime: { ts: Timestamp(1628869497, 1), t: 44 } }, $db: "wisteria_assets" }
     Plansummary: collscan // full table scan ixsan: full index scan, collscan: full table scan, idhack: ID query
     Keysexamined: 0 // the number of index keys scanned by mongodb for operation
     Docsexamined: 76476 // the number of documents in the collection scanned by mongodb for operation
     cursorExhausted:1 
     Numfields: 824 // // number of concessions, the number of times other operations are completed during operation.
     Nreturned: 23 // the number of documents returned by the operation
     queryHash:AF74EFB7 
     Plancachekey: 03e2cbd0 // used cache key
     Reslen: 11512 // returns the size of the data in bytes
     locks:{ 
         Replicationstatetransition: {acquirecount: {W: 825}}, // the number of times replicationstatetransition write locks were obtained
          Global: {acquirecount: {R: 825}}, // number of global read locks obtained 
          Database: {acquirecount: {R: 825}}, // number of database lock reads obtained
          Collection: { acquireCount: { r: 825 } }, 
          Mutex: { acquireCount: { r: 2 } } 
          } 
     flowControl:{
          acquireCount: 2, 
          acquireWaitCount: 2, 
          Timeacquiringmicros: 34859732 // indicates the time consumed by flow. This
          }
     storage:{ 
              data: { 
                  bytesRead: 37201774, 
                  bytesWritten: 35637499, 
                  Timereadingmicros: 9355695, // time spent reading data
                  Timewritingmicros: 2719607 // time spent writing data
                   }, 
                   Timewaitingmicros: {cache: 4760364} // time spent waiting
         } 
      protocol:op_ MSG 473472ms // time spent in the operation