// new-service.js router.on("/filter", function(req, res) { res.writeHead(200); res.end("OK"); } ); server = http.createServer(router); server.listen(3000);
// main-app.js if (testThisRequest) { hostpool.request( "/filter", {}, function(err, res) { if (err) { statsd.incr("svc.err"); } else { statsd.incr("svc.success"); } } ); }
// new-service.js router.on("/filter", function(req, res) { res.writeHead(200); var result = DOIT(req); var out = JSON.stringify(result); res.end(out); } ); server = http.createServer(router); server.listen(3000);
// new-service.js setInterval(function() { var mem = process.memoryUsage(); statsd.gauge('rss', mem.rss); statsd.gauge('heapTotal', mem.heapTotal); statsd.gauge('heapUsed', mem.heapUsed); }, 5000);
// main-app.js // in handle(request, result) { var text = // ... if (testThisRequest) { hostpool.request( "/filter", {}, function(err, res) { if (err) { statsd.incr("svc.err"); result.write(text); } else { statsd.incr("svc.success"); result.write(res.cleaned); } } ); } }
{name}/conf/{name}.ini
{name}/conf/{name}.nginx.proxy
{name}/conf/{name}.nginx.upstream
-l [LOG_LEVEL]
$ run_locally.sh name/
{name}/start.sh
conf/nginx/{role}.conf
conf/nginx/{host}.conf