mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 01:21:03 +01:00
SERVER-4552 avoid divide by zero error, just in case
This commit is contained in:
parent
01ab069471
commit
5ea3bf83f9
@ -228,7 +228,9 @@ namespace mongo {
|
||||
b.appendNumber( i->first , i->second );
|
||||
|
||||
b.appendNumber( "millisShardTotal" , millis );
|
||||
b.append( "millisShardAvg" , (int)((double)millis / numExplains ) );
|
||||
b.append( "millisShardAvg" ,
|
||||
numExplains ? static_cast<int>( static_cast<double>(millis) / numExplains )
|
||||
: 0 );
|
||||
b.append( "numQueries" , (int)numExplains );
|
||||
b.append( "numShards" , (int)out.size() );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user