Skip to content

Commit

Permalink
[VSC-6] Log total memory consumtion
Browse files Browse the repository at this point in the history
  • Loading branch information
krendelhoff2 committed Feb 21, 2025
1 parent 3a21d29 commit 4b2dae9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/server/test/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,15 @@ export async function measureRequest<T>(
): Promise<number> {
const start = performance.now();
await client.sendRequest<T>(method, params);
return performance.now() - start;
const end = performance.now();
const memory = process.memoryUsage();
setTimeout(() => {
const totalMemory = memory.heapUsed / 1024 / 1024;
console.log(
chalk.green(`TOTAL MEMORY USAGE: ${totalMemory.toFixed(2)} MB`),
);
}, 0);
return end - start;
}

export async function measureMultipleRequestConcurrent<T>(
Expand Down

0 comments on commit 4b2dae9

Please sign in to comment.