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 <deb2001-github@yahoo.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
PoojaDurgad authored and MylesBorins committed Apr 5, 2021
1 parent b40d35d commit 0243376
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 0243376

Please sign in to comment.