File size: 319 Bytes
483d458 |
1 2 3 4 5 6 7 8 9 10 11 12 |
import { AuditLog } from "../models/AuditLog.js";
export async function extractFeatures(log) {
const since = new Date(Date.now() - 10 * 60 * 1000);
const ipCount = await AuditLog.countDocuments({
ip: log.ip,
createdAt: { $gte: since },
});
return [log.createdAt.getHours(), Math.min(ipCount, 100)];
}
|