add more info to advanced db page

v1.18.x
Barış Soner Uşaklı 6 years ago
parent 4b486a808e
commit ed1bf9a16f

@ -18,6 +18,9 @@
"mongo.resident-memory": "Resident Memory",
"mongo.virtual-memory": "Virtual Memory",
"mongo.mapped-memory": "Mapped Memory",
"mongo.bytes-in": "Bytes In",
"mongo.bytes-out": "Bytes Out",
"mongo.num-requests": "Number of Requests",
"mongo.raw-info": "MongoDB Raw Info",
"redis": "Redis",
@ -30,6 +33,11 @@
"redis.total-connections-recieved": "Total Connections Received",
"redis.total-commands-processed": "Total Commands Processed",
"redis.iops": "Instantaneous Ops. Per Second",
"redis.iinput": "Instantaneous Input Per Second",
"redis.ioutput": "Instantaneous Output Per Second",
"redis.total-input": "Total Input",
"redis.total-output": "Total Ouput",
"redis.keyspace-hits": "Keyspace Hits",
"redis.keyspace-misses": "Keyspace Misses",
"redis.raw-info": "Redis Raw Info",

@ -501,7 +501,7 @@
// takes a string like 1000 and returns 1,000
addCommas: function (text) {
return text.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,');
return String(text).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,');
},
toISOString: function (timestamp) {

@ -9,6 +9,7 @@ var session = require('express-session');
var _ = require('lodash');
var semver = require('semver');
var prompt = require('prompt');
var utils = require('../utils');
var client;
var mongoModule = module.exports;
@ -240,6 +241,9 @@ mongoModule.info = function (db, callback) {
stats.mem.mapped = (stats.mem.mapped / 1024).toFixed(3);
stats.collectionData = results.listCollections;
stats.network = results.serverStatus.network;
stats.network.bytesIn = (stats.network.bytesIn / scale).toFixed(3);
stats.network.bytesOut = (stats.network.bytesOut / scale).toFixed(3);
stats.network.numRequests = utils.addCommas(stats.network.numRequests);
stats.raw = JSON.stringify(stats, null, 4);
stats.avgObjSize = stats.avgObjSize.toFixed(2);

@ -179,6 +179,15 @@ redisModule.info = function (cxn, callback) {
redisData[parts[0]] = parts[1];
}
});
redisData.keys = redisData['db' + nconf.get('redis:database')];
redisData.instantaneous_input = (redisData.instantaneous_input_kbps / 1024).toFixed(3);
redisData.instantaneous_output = (redisData.instantaneous_output_kbps / 1024).toFixed(3);
redisData.total_net_input = (redisData.total_net_input_bytes / (1024 * 1024 * 1024)).toFixed(3);
redisData.total_net_output = (redisData.total_net_output_bytes / (1024 * 1024 * 1024)).toFixed(3);
redisData.used_memory_human = (redisData.used_memory / (1024 * 1024 * 1024)).toFixed(3);
redisData.raw = JSON.stringify(redisData, null, 4);
redisData.redis = true;

@ -23,6 +23,10 @@
<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/>
<hr/>
<span>[[admin/advanced/database:mongo.bytes-in]]</span> <span class="text-right">[[admin/advanced/database:x-gb, {mongo.network.bytesIn}]]</span><br/>
<span>[[admin/advanced/database:mongo.bytes-out]]</span> <span class="text-right">[[admin/advanced/database:x-gb, {mongo.network.bytesOut}]]</span><br/>
<span>[[admin/advanced/database:mongo.num-requests]]</span> <span class="text-right">{mongo.network.numRequests}</span><br/>
</div>
</div>
</div>
@ -38,6 +42,7 @@
<span>[[admin/advanced/database:uptime-seconds]]</span> <span class="text-right formatted-number">{redis.uptime_in_seconds}</span><br/>
<span>[[admin/advanced/database:uptime-days]]</span> <span class="text-right">{redis.uptime_in_days}</span><br/>
<hr/>
<span>[[admin/advanced/database:redis.keys]]</span> <span class="text-right formatted-number">{redis.keys}</span><br/>
<span>[[admin/advanced/database:redis.connected-clients]]</span> <span class="text-right">{redis.connected_clients}</span><br/>
<span>[[admin/advanced/database:redis.connected-slaves]]</span> <span class="text-right">{redis.connected_slaves}</span><br/>
<span>[[admin/advanced/database:redis.blocked-clients]]</span> <span class="text-right">{redis.blocked_clients}</span><br/>
@ -49,6 +54,12 @@
<span>[[admin/advanced/database:redis.total-connections-recieved]]</span> <span class="text-right formatted-number">{redis.total_connections_received}</span><br/>
<span>[[admin/advanced/database:redis.total-commands-processed]]</span> <span class="text-right formatted-number">{redis.total_commands_processed}</span><br/>
<span>[[admin/advanced/database:redis.iops]]</span> <span class="text-right formatted-number">{redis.instantaneous_ops_per_sec}</span><br/>
<span>[[admin/advanced/database:redis.iinput]]</span> <span class="text-right">[[admin/advanced/database:x-mb, {redis.instantaneous_input}]]</span><br/>
<span>[[admin/advanced/database:redis.ioutput]]</span> <span class="text-right">[[admin/advanced/database:x-mb, {redis.instantaneous_output}]]</span><br/>
<span>[[admin/advanced/database:redis.total-input]]</span> <span class="text-right">[[admin/advanced/database:x-gb, {redis.total_net_input}]]</span><br/>
<span>[[admin/advanced/database:redis.total-output]]</span> <span class="text-right">[[admin/advanced/database:x-gb, {redis.total_net_output}]]</span><br/>
<hr/>
<span>[[admin/advanced/database:redis.keyspace-hits]]</span> <span class="text-right formatted-number">{redis.keyspace_hits}</span><br/>
<span>[[admin/advanced/database:redis.keyspace-misses]]</span> <span class="text-right formatted-number">{redis.keyspace_misses}</span><br/>

Loading…
Cancel
Save