Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-6625

db.adminCommand('top') seems to record commands as queries

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.2.2, 2.3.2
    • Affects Version/s: 2.0.6, 2.1.2
    • Component/s: Diagnostics
    • Labels:
      None
    • ALL

      In a database where the collection 'test.gamma' does not exist, I run the following shell command:

      >> for( i in [ 1, 2, 3, 4,5,6,7,8,9,10]) { db.gamma.insert(

      {x:i}

      ); db.gamma.count(); }

      I then run the following command to display the operations on that collection:

      >> db.adminCommand('top').totals['test.gamma'];

      {
      "total" :

      { "time" : 1036852, "count" : 30 }

      ,
      "readLock" :

      { "time" : 80, "count" : 20 }

      ,
      "writeLock" :

      { "time" : 1036772, "count" : 10 }

      ,
      "queries" :

      { "time" : 80, "count" : 20 }

      ,
      "getmore" :

      { "time" : 0, "count" : 0 }

      ,
      "insert" :

      { "time" : 1036772, "count" : 10 }

      ,
      "update" :

      { "time" : 0, "count" : 0 }

      ,
      "remove" :

      { "time" : 0, "count" : 0 }

      ,
      "commands" :

      { "time" : 0, "count" : 0 }


      }

      Note that the counts show 10 inserts 10 write locks, and also 20 read locks and 20 queries.

      I believe that it should show 0 queries and 10 commands.

      Checking with "db.serverStatus().opcounters" shows that there should be 0 queries and 10 commands.

            Assignee:
            sverch Shaun Verch
            Reporter:
            william.zola@10gen.com William Zola
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: