Files
2026-09-25 11:57:04 +08:00

11 lines
452 B
JavaScript

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));