[SERVER-2440] avgObjSize return Nan instead of 0 when there are no objects and running db.runCommand( { dbStats: 1}); Created: 31/Jan/11  Updated: 12/Jul/16  Resolved: 31/Jan/11

Status: Closed
Project: Core Server
Component/s: Admin
Affects Version/s: 1.6.5
Fix Version/s: 1.7.6

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

ubuntu


Operating System: Linux
Participants:

 Description   

Assuming admin db has no objects try In the shell:
> use admin;
> db.runCommand(

{ dbStats: 1}

);
> db.runCommand(

{ dbStats: 1}

);
{
"collections" : 0,
"objects" : 0,
"avgObjSize" : NaN,
"dataSize" : 0,
"storageSize" : 0,
"numExtents" : 0,
"indexes" : 0,
"indexSize" : 0,
"fileSize" : 0,
"ok" : 1
}

avgObjSize should be 0 instead of NaN

The binary part of the avgObjSize is:
1,97,118,103,79,98,106,83,105,122,101,0,0,0,0,0,0,0,248,255

0,0,0,0,0,0,248,255 is wrong.



 Comments   
Comment by auto [ 31/Jan/11 ]

Author:

{u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}

Message: if no objects in a db, make avgObjSize 0 not nan SERVER-2440
https://github.com/mongodb/mongo/commit/6a7e659b02ad151ae15f081d63cc38cc60f1c5fc

Generated at Thu Feb 08 02:59:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.