int scale = 1;
Integer s = BSONUtils.getInteger(command, "scale");
if (s != null)
scale = s;
MockDB db = data.get(database);
if (db == null)
db = new MockDB(database);
BasicBSONObject result = new BasicBSONObject("ok", 1).append("db",
database);
result.append("collections", db.countCollections());
int count = db.countObjects();
result.append("objects", count);
// TODO ? storage sizes make not much sense here...
int dataSize = 0;
result.append("dataSize", dataSize / scale);
result.append("avgObjectSize", count == 0 ? 0 : dataSize
/ (count * scale));
result.append("storageSize", dataSize);
result.append("numExtents", 1);
// just primary key indexes
result.append("indexes", db.countCollections());
result.append("indexSize", 0);
result.append("fileSize", 0);
result.append("nsSizeMB", 0);
return result;