diff options
author | Dan Pasette <dan@10gen.com> | 2013-01-13 07:20:25 +1100 |
---|---|---|
committer | Dan Pasette <dan@10gen.com> | 2013-03-20 17:46:48 -0400 |
commit | b0f59346069b9b007c1d7d4863b661d0bb06615b (patch) | |
tree | 036293471d52dd0d60b04f28a8a8f41c3d234946 | |
parent | 74323d671a216c8c87fcb295ed743f830d5212ee (diff) | |
download | mongo-b0f59346069b9b007c1d7d4863b661d0bb06615b.tar.gz |
SERVER-8116 - mongostat doesn't divide lock% by sampling interval
-rw-r--r-- | src/mongo/tools/stat_util.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/tools/stat_util.cpp b/src/mongo/tools/stat_util.cpp index 1f9111aebb3..26d62434770 100644 --- a/src/mongo/tools/stat_util.cpp +++ b/src/mongo/tools/stat_util.cpp @@ -122,6 +122,7 @@ namespace mongo { if (!isMongos) { if ( b["locks"].isABSONObj() ) { + // report either the global lock % or the db with the highest lock % + the global lock NamespaceStats prevStats = parseServerStatusLocks( a ); NamespaceStats curStats = parseServerStatusLocks( b ); vector<NamespaceDiff> diffs = computeDiff( prevStats , curStats ); @@ -131,7 +132,8 @@ namespace mongo { } else { - double uptimeMillis = diff( "uptimeMillis" , a , b ); + // diff() divides the result by _seconds, need total uptime here + double uptimeMillis = diff( "uptimeMillis" , a , b ) * _seconds; unsigned idx = diffs.size()-1; double lockToReport = diffs[idx].write; |