[SERVER-6625]  db.adminCommand('top') seems to record commands as queries Created: 27/Jul/12  Updated: 11/Jul/16  Resolved: 27/Nov/12

Status: Closed
Project: Core Server
Component/s: Diagnostics
Affects Version/s: 2.0.6, 2.1.2
Fix Version/s: 2.2.2, 2.3.2

Type: Bug Priority: Minor - P4
Reporter: William Zola Assignee: Shaun Verch
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-7774 Add jstest for db.adminCommand('top') Closed
Operating System: ALL
Participants:

 Description   

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.



 Comments   
Comment by Daniel Pasette (Inactive) [ 27/Nov/12 ]

breaking out jstest to separate task: SERVER-7774.

Comment by auto [ 11/Nov/12 ]

Author:

{u'date': u'2012-10-18T21:20:01Z', u'email': u'shaun.verch@10gen.com', u'name': u'Shaun Verch'}

Message: SERVER-6625 Log commands as commands instead of queries in top stats
Branch: v2.2
https://github.com/mongodb/mongo/commit/e716273e6e340b69d3ffc16545c297d76bca85fb

Comment by auto [ 08/Nov/12 ]

Author:

{u'date': u'2012-10-18T21:20:01Z', u'email': u'shaun.verch@10gen.com', u'name': u'Shaun Verch'}

Message: SERVER-6625 Log commands as commands instead of queries in top stats
Branch: master
https://github.com/mongodb/mongo/commit/8f98f933e8997db213994ab6f7de9908ba01ab8d

Generated at Thu Feb 08 03:12:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.