Skip to content

Commit

Permalink
test: use faster variant for rss
Browse files Browse the repository at this point in the history
PR-URL: #36839
Refs: #34291
Reviewed-By: Gerhard Stöbich <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
PoojaDurgad authored and MylesBorins committed Aug 31, 2021
1 parent d4362db commit b643fe7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/sequential/test-net-bytes-per-incoming-chunk-overhead.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const receivedChunks = [];
const N = 250000;

const server = net.createServer(common.mustCall((socket) => {
baseRSS = process.memoryUsage().rss;
baseRSS = process.memoryUsage.rss();

socket.setNoDelay(true);
socket.on('data', (chunk) => {
Expand All @@ -38,7 +38,7 @@ const server = net.createServer(common.mustCall((socket) => {
process.on('exit', () => {
global.gc();
const bytesPerChunk =
(process.memoryUsage().rss - baseRSS) / receivedChunks.length;
(process.memoryUsage.rss() - baseRSS) / receivedChunks.length;
// We should always have less than one page (usually ~ 4 kB) per chunk.
assert(bytesPerChunk < 650, `measured ${bytesPerChunk} bytes per chunk`);
});

0 comments on commit b643fe7

Please sign in to comment.