diff --git a/main.mjs b/main.mjs new file mode 100644 index 0000000..0f4e140 --- /dev/null +++ b/main.mjs @@ -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));