npmci/ts/npmci.monitor.ts

21 lines
583 B
TypeScript
Raw Normal View History

2017-05-18 20:40:09 +00:00
import * as plugins from './npmci.plugins'
import * as env from './npmci.env'
import { Smartmonitor } from 'smartmonitor'
export let npmciMonitor = new Smartmonitor()
2017-06-07 13:16:33 +00:00
let monitorEnvString: string = process.env.NPMCI_MONITOR
if (monitorEnvString) {
let npmciMonitorKeys: string[] = monitorEnvString.split('|')
2017-05-18 20:40:09 +00:00
npmciMonitor.addInstrumental({
2017-06-07 13:16:33 +00:00
apiKey: process.env.NPMCI_MONITOR
2017-05-18 20:40:09 +00:00
})
plugins.beautylog.info('Monitoring activated')
} else {
plugins.beautylog.warn('Monitoring could not be enabled due to missing API-KEY')
}
npmciMonitor.increment('lossless-ci.builds', 1)