chore(newrelic): some newrelic code location experiments

This commit is contained in:
Tyler Renelle
2014-01-30 13:43:30 -07:00
parent 416feca42e
commit 6f2f3dd71e
3 changed files with 4 additions and 8 deletions

View File

@@ -20,6 +20,6 @@ exports.config = {
* issues with the agent, 'info' and higher will impose the least overhead on
* production applications.
*/
level : 'trace'
level : 'warning'
}
};

View File

@@ -1,5 +1,6 @@
// Only do the minimal amount of work before forking just in case of a dyno restart
var nconf = require('nconf');
var utils = require('./utils');
utils.setupConfig();
require('coffee-script') // remove this once we've fully converted over
var express = require("express");
@@ -8,18 +9,12 @@ var path = require("path");
var domainMiddleware = require('domain-middleware');
var swagger = require("swagger-node-express");
var utils = require('./utils');
var middleware = require('./middleware');
var TWO_WEEKS = 1000 * 60 * 60 * 24 * 14;
var app = express();
var server;
// ------------ Setup configurations ------------
utils.setupConfig();
if (nconf.get('NODE_ENV') === 'production')
require('newrelic');
// ------------ MongoDB Configuration ------------
mongoose = require('mongoose');
require('./models/user'); //load up the user schema - TODO is this necessary?

View File

@@ -56,6 +56,7 @@ module.exports.setupConfig = function(){
if (nconf.get('NODE_ENV') === "development") {
Error.stackTraceLimit = Infinity;
}
if (nconf.get('NODE_ENV') === 'production') require('newrelic');
};