mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-31 19:15:58 +01:00
display both redis/mongo info if available
This commit is contained in:
@@ -158,6 +158,24 @@
|
||||
});
|
||||
};
|
||||
|
||||
module.info = function(db, callback) {
|
||||
db.stats({scale:1024}, function(err, stats) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
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.raw = JSON.stringify(stats, null, 4);
|
||||
stats.mongo = true;
|
||||
|
||||
callback(null, stats);
|
||||
});
|
||||
};
|
||||
|
||||
module.close = function() {
|
||||
db.close();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user