feat: add main.mjs
This commit is contained in:
10
main.mjs
Normal file
10
main.mjs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { correlate } from './src/correlate.mjs';
|
||||||
|
import { summarize } from './src/report.mjs';
|
||||||
|
|
||||||
|
const events = [
|
||||||
|
{ device: 'RIG-1', alarmId: 'TEMP', type: 'ACK', time: 20 },
|
||||||
|
{ device: 'RIG-1', alarmId: 'TEMP', type: 'ALARM', time: 10 },
|
||||||
|
{ device: 'RIG-1', alarmId: 'TEMP', type: 'CLEAR', time: 30 },
|
||||||
|
{ device: 'RIG-2', alarmId: 'VOLT', type: 'ALARM', time: 40 },
|
||||||
|
];
|
||||||
|
console.log(JSON.stringify(summarize(correlate(events)), null, 2));
|
||||||
Reference in New Issue
Block a user