Pingup
Usage
var pingup = ;app;
Options
Add monitoring for your Redis or MongoDB servers.
Redis
Pass a redis
client to pingup.status()
var redis = ;var redisClient = redis;app;
MongoDB
Pass a mongo
client to pingup.status()
var mongodb = ;mongodbMongoClient;
Multi-monitoring
You can also pass many clients of the same type, by passing an array instead of a single client.
var redis = ;var redisClient1 = redis;var redisClient2 = redis;app;
You can pass both redis
and mongo
to pingup.status()
, of course.
var redis = ;var redisClient1 = redis;var redisClient2 = redis; var mongodb = ;mongodbMongoClient;
Timeout
Pass timeout: seconds
to pingup.status()
. Default is 30 seconds.
pingupstatustimeout: 5; // set a 5 seconds timeout for each service
Try it
$ curl http://localhost:3000/pingup
{
"web": {
"up": true
},
"redis.0": {
"up": true
},
"redis.1": {
"up": true
},
"mongo": {
"up": true
}
}
Tests
To run the test suite first invoke the following command within the repo, installing the development dependencies:
$ npm install
then run the tests:
$ npm test