[SERVER-1123] better stats reporting for sizes Created: 14/May/10  Updated: 12/Jul/16  Resolved: 03/Jun/10

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 1.5.3

Type: New Feature Priority: Major - P3
Reporter: Kenny Gorman Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

A couple requests and a bug I think..there appears to be a missmatch of sizes from intra mongo to OS level:

1) I think it would be nice to have a breakdown of overall sizes for a database. So db.stats() is global and db.test.stats() is just for the test db.
2) It would be great if we could see a breakdown of all collections and sizes. For instance:

db.test.collectionstats()

{
foo:

{ objects: 9999, dataSize 88585, storageSize: 85858585, ....}

mybigcollection:

{ objects: 9999, dataSize 88585, storageSize: 85858585, ....}

baz:

{ objects: 9999, dataSize 88585, storageSize: 85858585, ....}

}

There appears to be a mis-match of sizes. I think it would be nice to call out sizes more specifically. For instance:

dataSize: size of extents, actual data used on disk.
indexSize: size of indexes, actual index size on disk
storageSize: size of indexes + data size on disk
totalStorage: size of datafiles on disk. totalStorage - storageSize = freespaceSize
freespaceSize: amount of freespace allocated in the database
oplogSize: total size of oplog

root@al01>cd /home/kgorman/mongodata/test/
root@al01>mongo
MongoDB shell version: 1.5.1
url: test
connecting to: test
type "help" for help
> db.stats()
{
"collections" : 3,
"objects" : 8284667,
"dataSize" : 2081753204,
"storageSize" : 2235783936,
"numExtents" : 26,
"indexes" : 3,
"indexSize" : 1304103744,
"ok" : 1
}
>
root@al01>ls -al /home/kgorman/mongodata/test/
total 4148212
drwxr-xr-x 2 root root 4096 May 14 14:07 .
drwxr-xr-x 6 kgorman kgorman 4096 May 14 14:03 ..
rw------ 1 root root 67108864 May 14 14:03 test.0
rw------ 1 root root 134217728 May 14 14:03 test.1
rw------ 1 root root 268435456 May 14 14:03 test.2
rw------ 1 root root 536870912 May 14 14:04 test.3
rw------ 1 root root 1073741824 May 14 14:05 test.4
rw------ 1 root root 2146435072 May 14 14:07 test.5
rw------ 1 root root 16777216 May 14 14:03 test.ns

> db.stats()
{
"collections" : 3,
"objects" : 8284667,
"dataSize" : 2081753204,
"storageSize" : 2235783936,
"numExtents" : 26,
"indexes" : 3,
"indexSize" : 1304103744,
"ok" : 1
}
> bye
root@al01>bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
1304103744+2081753204
3385856948



 Comments   
Comment by auto [ 03/Jun/10 ]

Author:

{'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}

Message: Add fileSize to db.stats() SERVER-1123
http://github.com/mongodb/mongo/commit/2f13545f3728b89cfe773cc0935080c67ca711b4

Comment by Kenny Gorman [ 28/May/10 ]

Yes, if fileSize == sum(datafile space on disk)

thx!

Comment by Mathias Stearn [ 25/May/10 ]

Kenny, just to confirm the outcome of our conversation, the only thing that needs to be added is fileSize?

Comment by Eliot Horowitz (Inactive) [ 24/May/10 ]

I think you and kenny already talked about this.

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