mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: script: storageUsage: use single event
This commit is contained in:
1 file changed
+12
-15
@@ -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: val._id,
|
||||||
message,
|
memory: Math.floor(val.size / 102.4) / 10,
|
||||||
memory: Math.floor(m[i].size / 102.4) / 10,
|
time: 0,
|
||||||
time: 0,
|
status: STATUS.STATUS_ACCEPTED,
|
||||||
status: STATUS.STATUS_ACCEPTED,
|
score: 0,
|
||||||
score: 0,
|
};
|
||||||
},
|
});
|
||||||
});
|
report({ cases, message: `Problem total ${totalProblemSize / 1024 / 1024} MB` });
|
||||||
totalProblemSize += m[i].size;
|
|
||||||
}
|
|
||||||
report({ message: `Problem total ${totalProblemSize / 1024 / 1024} MB` });
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user