diff --git a/src/database/mongo.js b/src/database/mongo.js index 389a85bf7d..49f2da5edd 100644 --- a/src/database/mongo.js +++ b/src/database/mongo.js @@ -177,16 +177,25 @@ }; module.info = function(db, callback) { - db.stats({scale:1024}, function(err, stats) { - if(err) { + async.parallel({ + serverStats: function(next) { + db.command({'serverStatus': 1}, next); + }, + stats: function(next) { + db.stats({scale:1024}, next); + } + }, function(err, results) { + if (err) { return callback(err); } + var stats = results.stats; stats.avgObjSize = (stats.avgObjSize / 1024).toFixed(2); stats.dataSize = (stats.dataSize / 1024).toFixed(2); stats.storageSize = (stats.storageSize / 1024).toFixed(2); stats.fileSize = (stats.fileSize / 1024).toFixed(2); stats.indexSize = (stats.indexSize / 1024).toFixed(2); + stats.mem = results.serverStats.mem; stats.raw = JSON.stringify(stats, null, 4); stats.mongo = true; diff --git a/src/views/admin/advanced/database.tpl b/src/views/admin/advanced/database.tpl index 0390e7a681..b868b322a9 100644 --- a/src/views/admin/advanced/database.tpl +++ b/src/views/admin/advanced/database.tpl @@ -13,6 +13,10 @@ Storage Size {mongo.storageSize} mb
Index Size {mongo.indexSize} mb
File Size {mongo.fileSize} mb
+
+ Resident Memory {mongo.mem.resident} mb
+ Virtual Memory {mongo.mem.virtual} mb
+ Mapped Memory {mongo.mem.mapped} mb