Skip to content
Browse files

Enhancement: config command for the admin interface

Related: #360
  • Loading branch information...
1 parent 67ffbff commit 7307b6ddc00cc89f5fb9975b0fd2613982d75b99 @till till committed
Showing with 21 additions and 1 deletion.
  1. +21 −1 stats.js
View
22 stats.js
@@ -259,7 +259,27 @@ config.configFile(process.argv[2], function (config, oldConfig) {
switch(cmd) {
case "help":
- stream.write("Commands: stats, counters, timers, gauges, delcounters, deltimers, delgauges, health, quit\n\n");
+ stream.write("Commands: stats, counters, timers, gauges, delcounters, deltimers, delgauges, health, config, quit\n\n");
+ break;
+
+ case "config":
+ stream.write("\n");
+ for (var prop in config) {
+ if (!config.hasOwnProperty(prop)) {
+ continue;
+ }
+ if (typeof config[prop] !== 'object') {
+ stream.write(prop + ": " + config[prop] + "\n");
+ continue;
+ }
+ subconfig = config[prop];
+ for (var subprop in subconfig) {
+ if (!subconfig.hasOwnProperty(subprop)) {
+ continue;
+ }
+ stream.write(prop + " > " + subprop + ": " + subconfig[subprop] + "\n");
+ }
+ }
break;
case "health":

0 comments on commit 7307b6d

Please sign in to comment.
Something went wrong with that request. Please try again.