core: script: storageUsage: use single event

This commit is contained in:
undefined committed 2025-12-17 04:01:32 +08:00
1 parent 34f44fada1
commit b306bbd087
1 file changed
+7 -10
+7 -10
View File
@@ -11,21 +11,18 @@ export async function run(_, report) {
{ $match: { size: { $gt: 10 * 1024 * 1024 } } }, { $match: { size: { $gt: 10 * 1024 * 1024 } } },
{ $sort: { size: -1 } }, { $sort: { size: -1 } },
]).toArray(); ]).toArray();
for (let i = 0; i < m.length; i++) { const cases = m.map((val, i) => {
const message = m[i]._id; totalProblemSize += val.size;
report({ return {
case: {
id: i + 1, id: i + 1,
message, message: val._id,
memory: Math.floor(m[i].size / 102.4) / 10, memory: Math.floor(val.size / 102.4) / 10,
time: 0, time: 0,
status: STATUS.STATUS_ACCEPTED, status: STATUS.STATUS_ACCEPTED,
score: 0, score: 0,
}, };
}); });
totalProblemSize += m[i].size; report({ cases, message: `Problem total ${totalProblemSize / 1024 / 1024} MB` });
}
report({ message: `Problem total ${totalProblemSize / 1024 / 1024} MB` });
return true; return true;
} }