[SERVER-6266] mongotop reports different lock times with --locks than without Created: 01/Jul/12  Updated: 15/Aug/12  Resolved: 06/Jul/12

Status: Closed
Project: Core Server
Component/s: Tools
Affects Version/s: 2.1.2
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Daniel Pasette (Inactive) Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Operating System: ALL
Participants:

 Description   

When concurrently running "mongotop" and "mongotop --locks", "mongotop --locks" shows much lower lock times than "mongotop" throughout the insertion run. I would also expect that the "." to sum to total for all dbs.

Test:

for (i = 0; i < 1000000; i++) { db.top.insert({x:i}); }

mongotop --locks:

dan:(git)mongo[master]/$ ./mongotop --locks
connected to: 127.0.0.1
 
                                                          ns       total        read       write		2012-07-01T03:52:11
                                                         foo       665ms         0ms       665ms
                                                           .       219ms        15ms       204ms
                                                        test         0ms         0ms         0ms
                                                       local         0ms         0ms         0ms

mongotop:

dan:(git)mongo[master]/$ ./mongotop 
connected to: 127.0.0.1
 
                                                                         ns       total        read       write		2012-07-01T03:52:11
                                                                    foo.top       223ms         0ms       223ms
                                                                     admin.         1ms         1ms         0ms
                                                     dan2.system.namespaces         0ms         0ms         0ms



 Comments   
Comment by Eliot Horowitz (Inactive) [ 03/Jul/12 ]

We can probably optimize this a fair bit so the delta is even smaller.

Comment by Eliot Horowitz (Inactive) [ 03/Jul/12 ]

This is basically "correct"
The difference is the overhead of setting up the context after we are locked.

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