Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

SERVER-8116 - mongostat doesn't divide lock% by sampling interval

  • Loading branch information...
commit b0f59346069b9b007c1d7d4863b661d0bb06615b 1 parent 74323d6
@monkey101 monkey101 authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/mongo/tools/stat_util.cpp
View
4 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;
Please sign in to comment.
Something went wrong with that request. Please try again.