[SERVER-7347] Do not scale avgObjSize in db.stats() for mongos to be consistent with mongod Created: 13/Oct/12  Updated: 11/Jul/16  Resolved: 10/Dec/12

Status: Closed
Project: Core Server
Component/s: Diagnostics
Affects Version/s: 2.2.0
Fix Version/s: 2.3.2

Type: Bug Priority: Trivial - P5
Reporter: Matthew Darby Assignee: Shaun Verch
Resolution: Done Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-19533 collStats through mongoS on sharded c... Closed
Operating System: ALL
Participants:

 Description   

db.stats() returns the same avgObjSize regardless of scale value passed.
The help string for db.stats() does not state the behaviour of the scale value on avgObjSize, but the documentation project states that it is affected by the scale value.
Confusingly, db.collection.stats()'s version of avgObjSize DOES scale according to the value passed. This is incorrect the help string for the function, but correct according to the documentation project.

http://docs.mongodb.org/manual/reference/database-statistics/

> db.stats(1024)
{
	"db" : "test",
	"collections" : 4,
	"objects" : 11,
	"avgObjSize" : 55.27272727272727,
	"dataSize" : 0,
	"storageSize" : 16,
	"numExtents" : 4,
	"indexes" : 3,
	"indexSize" : 23,
	"fileSize" : 196608,
	"nsSizeMB" : 16,
	"ok" : 1
}
> db.stats()
{
	"db" : "test",
	"collections" : 4,
	"objects" : 11,
	"avgObjSize" : 55.27272727272727,
	"dataSize" : 608,
	"storageSize" : 16384,
	"numExtents" : 4,
	"indexes" : 3,
	"indexSize" : 24544,
	"fileSize" : 201326592,
	"nsSizeMB" : 16,
	"ok" : 1
}



 Comments   
Comment by auto [ 10/Dec/12 ]

Author:

{u'date': u'2012-11-28T01:27:59Z', u'email': u'shaun.verch@10gen.com', u'name': u'Shaun Verch'}

Message: SERVER-7347 Do not scale avgObjSize for mongos db.stats() to be consistent with mongod
Branch: master
https://github.com/mongodb/mongo/commit/fd0caa0cb1e24aaba10d6b4882b97ee50868a0b0

Comment by Matthew Darby [ 13/Oct/12 ]

This issue affects the latest version of the core server, pulled fresh from the master branch today.

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