task-manager
Version:
task-manager for cluster or single application
12 lines (9 loc) • 403 B
JavaScript
;
function memory(sock, command, workers, next) {
for (var memory = process.memoryUsage(), keys = Object.keys(memory), output = "", i = 0, ii = keys.length; i < ii; ++i) {
var index = memory[keys[i]];
output += "> " + keys[i] + ": " + index + "\n";
}
return next(sock, output, memory);
}
module.exports.body = memory, module.exports.regex = /^memory[\r]?\n$/i;