ali-cloudmonitor
Aliyun cloudmonitor sdk for node.js
Install
$ npm i ali-cloudmonitor --save
Usage
const AliCloudmonitor = require('ali-cloudmonitor')
const aliCloudmonitor = new AliCloudmonitor({
accessKeyId: 'xxx',
accessKeySecret: 'xxx',
})
aliCloudmonitor.sendMetric([{
groupId: 1,
metricName: 'test',
dimensions: {
name: 'test',
count: Math.random()
},
time: Date.now(),
type: 0,
period: 60,
values: {
value: 10
}
}]).then(console.log).catch(console.error)
aliCloudmonitor.sendEvent([{
name: 'test',
groupId: 2,
time: Date.now(),
content: 'This is a event'
}]).then(console.log).catch(console.error)
Test
$ npm test