btrz-health-check
Advanced tools
Comparing version 1.3.0 to 1.3.1
{ | ||
"name": "btrz-health-check", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "A series of classes that will ping different service types to verify accessibility.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -84,1 +84,25 @@ # btrz-health-check [![Circle CI](https://circleci.com/gh/Betterez/btrz-health-check.svg?style=svg)](https://circleci.com/gh/Betterez/btrz-health-check) [![NPM version](https://badge-me.herokuapp.com/api/npm/btrz-health-check.png)](http://badges.enytc.com/for/npm/btrz-health-check) | ||
Internally we will call the `collectionNames()` function, so it should at least implement that function. | ||
### Socket | ||
Will check connectivity to a socket server using the `net` module | ||
{name: "Socket", status: 200} //if promise resolves | ||
{name: "Socket", status: 200} //if promise rejects | ||
#### Usage | ||
let SocketHealthChecker = require("btrz-health-checker").SocketHealthChecker; | ||
let socketChecker = new SocketHealthChecker(mongoDriver); | ||
socketChecker.checkStatus() | ||
.then(function (result) { | ||
//If's working fine | ||
}) | ||
.catch(function (result) { | ||
//Something is not wright. | ||
}); | ||
The only mandatory parameter is a config literal with a host and port to connect to. | ||
The config can also contains a `timeout` property and it will be use to fail in case the timeout is reached, the default value is 5000. |
22066
108