lib/index.js
/**
 * Get the status of cluster an send response with this
 * @param  {Object} Response of express
 */
Get the status of cluster an send response with this
@param  {Object} Response of express
Get the status of cluster an send response with this @param { Object } Response of express
function status(res){
	res.set('Content-Type', 'application/json');
	var statusResponse = {};
	statusResponse.workers = [];
	async.parallel([
		function(callback){
			pidusage.stat(process.pid, function(err,stats){
				if(err){
					callback(err);
				}
				else{					
					stats.pid = process.pid;
					statusResponse.cluster = stats;					
					callback();
				}
			});
		},
		function(callback){
			async.each(Object.keys(cluster.workers), function(id, done){
				statusWorker(id, function(err, stats){
					if(err){
						done(err);
					}
					else{
						statusResponse.workers.push(stats);
						done();
					}	
				});
			},function(err){
				callback(err);
			});
		}
	],
	function(err, results){
		if(err){
			responseError(err);
		}
		else{
			res.send(JSON.stringify(statusResponse));
		}
	});
}
function status ( res ) { res . set ( 'Content-Type' , 'application/json' ) ; var statusResponse = { } ; statusResponse . workers = [ ] ; async . parallel ( [ function ( callback ) { pidusage . stat ( process . pid , function ( err , stats ) { if ( err ) { callback ( err ) ; } else { stats . pid = process . pid ; statusResponse . cluster = stats ; callback ( ) ; } } ) ; } , function ( callback ) { async . each ( Object . keys ( cluster . workers ) , function ( id , done ) { statusWorker ( id , function ( err , stats ) { if ( err ) { done ( err ) ; } else { statusResponse . workers . push ( stats ) ; done ( ) ; } } ) ; } , function ( err ) { callback ( err ) ; } ) ; } ] , function ( err , results ) { if ( err ) { responseError ( err ) ; } else { res . send ( JSON . stringify ( statusResponse ) ) ; } } ) ; }
Get the status of cluster an send response with this
 @param  {Object} Response of express
Get the status of cluster an send response with this @param { Object } Response of express
//get the status of cluster process //get the status of workers