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 targos committed Aug 8, 2021
1 parent dade545 commit 45bf825
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
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 45bf825

Please sign in to comment.