Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes for metrics workflow.

  • Loading branch information...
commit a144f6b3a3d7aa9a442193aef4fa54a75004bb41 1 parent b588496
@mde mde authored
View
1  Jakefile
@@ -58,6 +58,7 @@ namespace('gen', function () {
, 'mkdir -p ./' + dir + '/app/controllers'
, 'mkdir -p ./' + dir + '/lib'
, 'mkdir -p ./' + dir + '/log'
+ , 'mkdir -p ./' + dir + '/node_modules'
, 'cp -r ' + templateDir + '/views ' + dir + '/app/'
, 'cp -r ' + templateDir + '/public ' + dir
, 'cp ' + templateDir + '/router.js ' + dir + '/config/'
View
2  lib/base_config.js
@@ -33,6 +33,8 @@
}
// Key for when using Cookie session-store
, cookieSessionKey: 'sdata'
+// Should be an object literal with config opts if used
+, metrics: null
};
module.exports = config;
View
19 lib/cluster/master.js
@@ -136,15 +136,18 @@ Master.prototype = new (function () {
rotateAndInitByType();
}
, _startMetrics = function (next) {
- var self = this;
- if (self.config.metrics) {
+ var metrics
+ , port;
+ if (this.config.metrics) {
try {
- var metrics = require(process.cwd() + '/node_modules/metrics')
- , port = self.config.metrics.port || 9091;
- self.stdoutLog.info("Metrics server started on port " + port);
- self.metricsServer = new metrics.Server(port);
- } catch(e) {
- throw e;//new Error("To turn on Metrics, do `npm install metrics`. Couldn't find it at: " + process.cwd() + "/node_modules/metrics");
+ port = this.config.metrics.port;
+ metrics = require(process.cwd() + '/node_modules/metrics');
+ this.stdoutLog.info("Metrics server started on port " + port);
+ this.metricsServer = new metrics.Server(port);
+ }
+ catch(e) {
+ throw new Error("To turn on Metrics, do `npm install metrics`. " +
+ "Couldn't find it at: " + process.cwd() + "/node_modules/metrics");
}
}
next();
View
5 templates/base/environment.js
@@ -1,4 +1,9 @@
var config = {
+ /*
+ metrics: {
+ port: 4001
+ }
+ */
};
module.exports = config;
Please sign in to comment.
Something went wrong with that request. Please try again.