[SERVER-13368] Need to expose better timing information in currentOps Created: 26/Mar/14  Updated: 10/Nov/15  Resolved: 18/Apr/14

Status: Closed
Project: Core Server
Component/s: Diagnostics
Affects Version/s: None
Fix Version/s: 2.6.2, 2.7.0

Type: Improvement Priority: Major - P3
Reporter: Domas Mituzas Assignee: Scott Hernandez (Inactive)
Resolution: Done Votes: 2
Labels: currentOp, stats
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-2778 Microsecond or nanosecond accuracy in... Closed
is duplicated by SERVER-3057 Add millisecond view to current opera... Closed
Backport Completed:
Participants:

 Description   

Currently MongoDB internally tracks things at microsecond granularity, yet exports such as currentOp only show "secs_running", making web level latencies all rounded down to zero.

It may make sense to provide highly accurate elapsed data (as "secs" is already derived from it), and easiest way is probably just by having a separate counter as msecs (or usecs, if need be for a 64bit value).

The change is minimal yet the value for systems administrator is relatively large:

diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp
index 2b74983..01d78ec 100644
— a/src/mongo/db/curop.cpp
+++ b/src/mongo/db/curop.cpp
@@ -219,6 +219,7 @@ namespace mongo {

if( a )

{ b.append("secs_running", elapsedSeconds() ); + b.append("msecs_running", elapsedMillis() ); }

b.append( "op" , opToString( _op ) );



 Comments   
Comment by Githook User [ 15/May/14 ]

Author:

{u'username': u'scotthernandez', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}

Message: SERVER-13368: Expose microsecs_running in currentOp
(cherry picked from commit 9dc581691ba4b7fbd84fbb985a4ab826c02abd4d)
Branch: v2.6
https://github.com/mongodb/mongo/commit/68ae4983b197cf853ae3367a95a03a4946141115

Comment by Githook User [ 18/Apr/14 ]

Author:

{u'username': u'scotthernandez', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}

Message: SERVER-13368: Expose microsecs_running in currentOp
Branch: master
https://github.com/mongodb/mongo/commit/9dc581691ba4b7fbd84fbb985a4ab826c02abd4d

Comment by Domas Mituzas [ 26/Mar/14 ]

http://p.defau.lt/?HMHhgsW1Wn75P7d_VKHPig has a bit nicer formatting for this huge patch

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