-
Type: New Feature
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
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:
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