npmci/ts/npmci.monitor.ts

23 lines
552 B
TypeScript
Raw Permalink Normal View History

2018-04-04 20:25:13 +00:00
import * as plugins from './npmci.plugins';
import * as env from './npmci.env';
2017-05-18 20:40:09 +00:00
2018-04-04 20:25:13 +00:00
import { Analytics } from 'smartanalytics';
2017-05-18 20:40:09 +00:00
2017-09-08 12:58:44 +00:00
export let npmciAnalytics = new Analytics({
2017-09-08 16:24:34 +00:00
apiEndPoint: 'https://pubapi.lossless.one/analytics',
2017-09-08 12:58:44 +00:00
projectId: 'gitzone',
appName: 'npmci'
2018-04-04 20:25:13 +00:00
});
2017-05-18 20:40:09 +00:00
2017-09-08 21:16:09 +00:00
export let run = async () => {
2018-04-04 20:25:13 +00:00
npmciAnalytics
.recordEvent('npmToolExecution', {
host: env.repo.host,
user: env.repo.user,
repo: env.repo.repo
})
.catch(err => {
plugins.beautylog.warn('Lossless Analytics API not available...');
});
};