cloudwatch-custom
v1.0.0
Published
Aggregate and send custom metrics to cloudwatch
Downloads
2
Readme
Install
$ npm install --save cloudwatch-custom
Usage
var CloudWatchData = require('cloudwatch-custom');
var aws = {
region : 'us-east-1',
accessKeyId : 'your-key',
secretAccessKey : 'your-secret',
};
var cloudwatch = new CloudWatchData(aws, 'your-namespace');
// track some metrics
cloudwatch.increment('user-created');
cloudwatch.increment('ios-push');
// send to cloudwatch every 5 minutes
new CronJob('0 */5 * * * *', function() {
cloudwatch
.send()
.then(function (data) {
console.log(data);
})
.catch(function (err) {
console.log(err);
});
}, null, true);
License
MIT