mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
(test) Report final RSS/committed in scripts/runner.node.mjs
This commit is contained in:
@@ -2509,6 +2509,9 @@ export async function main() {
|
||||
const results = await runTests();
|
||||
const ok = results.every(({ ok }) => ok);
|
||||
|
||||
console.log("Final RSS:", (process.memoryUsage.rss() / 1024 / 1024) | 0, "MiB");
|
||||
console.log("Final committed:", Math.round((100 * getCommitted()) / 1024 ** 2) / 100, "GiB");
|
||||
|
||||
let waitForUser = false;
|
||||
while (isCI) {
|
||||
const userCount = getLoggedInUserCountOrDetails();
|
||||
@@ -2536,3 +2539,13 @@ export async function main() {
|
||||
}
|
||||
|
||||
await main();
|
||||
|
||||
function getCommitted() {
|
||||
let child;
|
||||
if (process.platform === "win32") {
|
||||
child = spawnSync("wmic", ["process", "where", `processid=${process.pid}`, "get", "PageFileUsage"]);
|
||||
} else {
|
||||
child = spawnSync("ps", ["-o", "vsz", "-p", process.pid.toString()]);
|
||||
}
|
||||
return parseInt(child.stdout.toString().split("\n")[1].trim());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user