This commit is contained in:
tknew2 2014-05-26 19:17:37 +02:00
parent 51569c1696
commit 4e1888ea8a
5 changed files with 80 additions and 5 deletions

View File

@ -32,9 +32,9 @@ Works on Linux & MacOS.
<!-- ### Build Status -->
<!-- Master: [![Build Status](https://api.travis-ci.org/Unitech/pm2.png?branch=master)](https://travis-ci.org/Unitech/pm2) -->
Master: [![Build Status](https://api.travis-ci.org/Unitech/pm2.png?branch=master)](https://travis-ci.org/Unitech/pm2)
<!-- Development: [![Build Status](https://api.travis-ci.org/Unitech/pm2.png?branch=development)](https://travis-ci.org/Unitech/pm2) -->
Development: [![Build Status](https://api.travis-ci.org/Unitech/pm2.png?branch=development)](https://travis-ci.org/Unitech/pm2)
## Monitoring dashboard

View File

@ -0,0 +1,7 @@
var axm = require('axm');
axm.action('refresh:db', function(reply) {
console.log('Refreshing');
reply({success : true});
});

View File

@ -0,0 +1,22 @@
var axm = require('axm');
axm.action('refresh:db', { comment : 'Refresh the database' }, function(reply) {
console.log('Refreshing');
reply({success : true});
});
axm.action('chanme:ladb', { comment : 'Refresh la BIG database' }, function(reply) {
console.log('Refreshing BIG DB');
reply({success : true});
});
axm.action('rm:rf', { comment : 'Delete moi ca plus vite que ca !' }, function(reply) {
console.log('RMING RFING');
reply({success : true});
});
axm.action('rm:roff', function(reply) {
console.log('RMING RFING');
reply({success : true});
});

48
examples/load-me.js Normal file
View File

@ -0,0 +1,48 @@
var stop = false;
function add(a, b) {
while (a.length < b.length) a.unshift(0);
while (a.length > b.length) b.unshift(0);
var carry = 0, sum = []
for (var i = a.length - 1; i >= 0; i--) {
var s = a[i] + b[i] + carry;
if (s >= 10) {
s = s - 10;
carry = 1;
} else {
carry = 0;
}
sum.unshift(s);
}
if (carry)
sum.unshift(carry);
return sum;
}
function fib(n) {
var f1 = [0];
var f2 = [1];
while (n--) {
var f3 = add(f1, f2)
if (stop) return false;
f1 = f2;
f2 = f3;
}
return f1.join("");
}
var axm = require('axm');
axm.action('load:start', function(reply) {
fib(50000);
reply({success : true});
});
axm.action('load:stop', function(reply) {
stop = true;
reply({success : true});
});

View File

@ -64,9 +64,7 @@
"description": "Modern CLI process manager for Node apps with a builtin load-balancer",
"main": "index.js",
"scripts": {
"test": "bash ./test/cli.sh && bash ./test/json_file.sh && bash ./test/harmony.sh && bash ./test/reload.sh && bash ./test/right-exit-code.sh && bash ./test/log-reload.sh && bash ./test/gracefulReload.sh && bash ./test/cli2.sh && bash ./test/misc.sh && bash ./test/watchdog.sh && bash ./test/fork.sh && bash ./test/infinite_loop.sh && NODE_ENV=test ./node_modules/mocha/bin/mocha test",
"install" : "node scripts/install.js",
"update" : "node scripts/install.js"
"test": "bash ./test/cli.sh && bash ./test/json_file.sh && bash ./test/harmony.sh && bash ./test/reload.sh && bash ./test/right-exit-code.sh && bash ./test/log-reload.sh && bash ./test/gracefulReload.sh && bash ./test/cli2.sh && bash ./test/misc.sh && bash ./test/watchdog.sh && bash ./test/fork.sh && bash ./test/infinite_loop.sh && NODE_ENV=test ./node_modules/mocha/bin/mocha test"
},
"keywords": [
"cli",