show database values in gbs

v1.18.x
barisusakli 8 years ago
parent 08049c0712
commit b91b41dfa3

@ -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",

@ -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);

@ -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;

@ -13,16 +13,16 @@
<span>[[admin/advanced/database:mongo.objects]]</span> <span class="text-right formatted-number">{mongo.objects}</span><br/>
<span>[[admin/advanced/database:mongo.avg-object-size]]</span> <span class="text-right">[[admin/advanced/database:x-b, {mongo.avgObjSize}]]</span><br/>
<hr/>
<span>[[admin/advanced/database:mongo.data-size]]</span> <span class="text-right">[[admin/advanced/database:x-mb, {mongo.dataSize}]]</span><br/>
<span>[[admin/advanced/database:mongo.storage-size]]</span> <span class="text-right">[[admin/advanced/database:x-mb, {mongo.storageSize}]]</span><br/>
<span>[[admin/advanced/database:mongo.index-size]]</span> <span class="text-right">[[admin/advanced/database:x-mb, {mongo.indexSize}]]</span><br/>
<span>[[admin/advanced/database:mongo.data-size]]</span> <span class="text-right">[[admin/advanced/database:x-gb, {mongo.dataSize}]]</span><br/>
<span>[[admin/advanced/database:mongo.storage-size]]</span> <span class="text-right">[[admin/advanced/database:x-gb, {mongo.storageSize}]]</span><br/>
<span>[[admin/advanced/database:mongo.index-size]]</span> <span class="text-right">[[admin/advanced/database:x-gb, {mongo.indexSize}]]</span><br/>
<!-- IF mongo.fileSize -->
<span>[[admin/advanced/database:mongo.file-size]]</span> <span class="text-right">[[admin/advanced/database:x-mb, {mongo.fileSize}]]</span><br/>
<span>[[admin/advanced/database:mongo.file-size]]</span> <span class="text-right">[[admin/advanced/database:x-gb, {mongo.fileSize}]]</span><br/>
<!-- ENDIF mongo.fileSize -->
<hr/>
<span>[[admin/advanced/database:mongo.resident-memory]]</span> <span class="text-right">[[admin/advanced/database:x-mb, {mongo.mem.resident}]]</span><br/>
<span>[[admin/advanced/database:mongo.virtual-memory]]</span> <span class="text-right">[[admin/advanced/database:x-mb, {mongo.mem.virtual}]]</span><br/>
<span>[[admin/advanced/database:mongo.mapped-memory]]</span> <span class="text-right">[[admin/advanced/database:x-mb, {mongo.mem.mapped}]]</span><br/>
<span>[[admin/advanced/database:mongo.resident-memory]]</span> <span class="text-right">[[admin/advanced/database:x-gb, {mongo.mem.resident}]]</span><br/>
<span>[[admin/advanced/database:mongo.virtual-memory]]</span> <span class="text-right">[[admin/advanced/database:x-gb, {mongo.mem.virtual}]]</span><br/>
<span>[[admin/advanced/database:mongo.mapped-memory]]</span> <span class="text-right">[[admin/advanced/database:x-gb, {mongo.mem.mapped}]]</span><br/>
</div>
</div>
</div>
@ -43,7 +43,7 @@
<span>[[admin/advanced/database:redis.blocked-clients]]</span> <span class="text-right">{redis.blocked_clients}</span><br/>
<hr/>
<span>[[admin/advanced/database:redis.used-memory]]</span> <span class="text-right">{redis.used_memory_human}</span><br/>
<span>[[admin/advanced/database:redis.used-memory]]</span> <span class="text-right">[[admin/advanced/database:x-gb, {redis.used_memory_human}]]</span><br/>
<span>[[admin/advanced/database:redis.memory-frag-ratio]]</span> <span class="text-right">{redis.mem_fragmentation_ratio}</span><br/>
<hr/>
<span>[[admin/advanced/database:redis.total-connections-recieved]]</span> <span class="text-right formatted-number">{redis.total_connections_received}</span><br/>

Loading…
Cancel
Save