diff --git a/public/language/en-GB/admin/advanced/database.json b/public/language/en-GB/admin/advanced/database.json index f7db6220ee..b88ca6fc82 100644 --- a/public/language/en-GB/admin/advanced/database.json +++ b/public/language/en-GB/admin/advanced/database.json @@ -1,6 +1,7 @@ { "x-b": "%1 b", "x-mb": "%1 mb", + "x-gb": "%1 gb", "uptime-seconds": "Uptime in Seconds", "uptime-days": "Uptime in Days", diff --git a/src/database/mongo.js b/src/database/mongo.js index aadd5dbfe7..273ec18001 100644 --- a/src/database/mongo.js +++ b/src/database/mongo.js @@ -201,7 +201,7 @@ mongoModule.info = function (db, callback) { return callback(err); } var stats = results.stats; - var scale = 1024 * 1024; + var scale = 1024 * 1024 * 1024; results.listCollections = results.listCollections.map(function (collectionInfo) { return { @@ -216,6 +216,10 @@ mongoModule.info = function (db, callback) { }); stats.mem = results.serverStatus.mem; + stats.mem = results.serverStatus.mem; + stats.mem.resident = (stats.mem.resident / 1024).toFixed(2); + stats.mem.virtual = (stats.mem.virtual / 1024).toFixed(2); + stats.mem.mapped = (stats.mem.mapped / 1024).toFixed(2); stats.collectionData = results.listCollections; stats.network = results.serverStatus.network; stats.raw = JSON.stringify(stats, null, 4); diff --git a/src/database/redis.js b/src/database/redis.js index 0127a61600..9ebc154705 100644 --- a/src/database/redis.js +++ b/src/database/redis.js @@ -152,7 +152,7 @@ redisModule.info = function (cxn, callback) { redisData[parts[0]] = parts[1]; } }); - + redisData.used_memory_human = (redisData.used_memory / (1024 * 1024 * 1024)).toFixed(2); redisData.raw = JSON.stringify(redisData, null, 4); redisData.redis = true; diff --git a/src/views/admin/advanced/database.tpl b/src/views/admin/advanced/database.tpl index c9003e52f9..9519ce9141 100644 --- a/src/views/admin/advanced/database.tpl +++ b/src/views/admin/advanced/database.tpl @@ -13,16 +13,16 @@ [[admin/advanced/database:mongo.objects]] {mongo.objects}
[[admin/advanced/database:mongo.avg-object-size]] [[admin/advanced/database:x-b, {mongo.avgObjSize}]]

- [[admin/advanced/database:mongo.data-size]] [[admin/advanced/database:x-mb, {mongo.dataSize}]]
- [[admin/advanced/database:mongo.storage-size]] [[admin/advanced/database:x-mb, {mongo.storageSize}]]
- [[admin/advanced/database:mongo.index-size]] [[admin/advanced/database:x-mb, {mongo.indexSize}]]
+ [[admin/advanced/database:mongo.data-size]] [[admin/advanced/database:x-gb, {mongo.dataSize}]]
+ [[admin/advanced/database:mongo.storage-size]] [[admin/advanced/database:x-gb, {mongo.storageSize}]]
+ [[admin/advanced/database:mongo.index-size]] [[admin/advanced/database:x-gb, {mongo.indexSize}]]
- [[admin/advanced/database:mongo.file-size]] [[admin/advanced/database:x-mb, {mongo.fileSize}]]
+ [[admin/advanced/database:mongo.file-size]] [[admin/advanced/database:x-gb, {mongo.fileSize}]]

- [[admin/advanced/database:mongo.resident-memory]] [[admin/advanced/database:x-mb, {mongo.mem.resident}]]
- [[admin/advanced/database:mongo.virtual-memory]] [[admin/advanced/database:x-mb, {mongo.mem.virtual}]]
- [[admin/advanced/database:mongo.mapped-memory]] [[admin/advanced/database:x-mb, {mongo.mem.mapped}]]
+ [[admin/advanced/database:mongo.resident-memory]] [[admin/advanced/database:x-gb, {mongo.mem.resident}]]
+ [[admin/advanced/database:mongo.virtual-memory]] [[admin/advanced/database:x-gb, {mongo.mem.virtual}]]
+ [[admin/advanced/database:mongo.mapped-memory]] [[admin/advanced/database:x-gb, {mongo.mem.mapped}]]
@@ -43,7 +43,7 @@ [[admin/advanced/database:redis.blocked-clients]] {redis.blocked_clients}

- [[admin/advanced/database:redis.used-memory]] {redis.used_memory_human}
+ [[admin/advanced/database:redis.used-memory]] [[admin/advanced/database:x-gb, {redis.used_memory_human}]]
[[admin/advanced/database:redis.memory-frag-ratio]] {redis.mem_fragmentation_ratio}

[[admin/advanced/database:redis.total-connections-recieved]] {redis.total_connections_received}