-
Notifications
You must be signed in to change notification settings - Fork 17
API and KPIs
willyaranda edited this page Oct 29, 2012
·
1 revision
- Add a
var API = require('../common/API').API;
to load the API. - On your
main.js::start()
method, add the lineAPI.addServers('NS_AS', this.servers);
, where'NS_AS'
is the name of the main service that want you to monitor. - On your server file, implement a
getStats()
method, that should return a JSON with the info you want to return to the API.
getStats: function() {
return stats;
}
- Also, add a global object like this:
// Global stats object
var stats = {
notifications: {
received: 0,
rejected: {
badJSON: 0, // Done
notSigned: 0,
tooBig: 0
},
accepted: 0
},
httpRequests: {
total: 0,
notify: 0,
about: 0,
other: 0
}
};
And update where you think it's OK.
Visit the URL where your stats should be placed, and have fun!!
e.g: http://push.telefonica.es:12345/