Skip to content

Commit

Permalink
test: use faster variant for rss
Browse files Browse the repository at this point in the history
in test-net-bytes-per-incoming-chunk-overhead.js
  • Loading branch information
PoojaDurgad committed Jan 8, 2021
1 parent 67c8e2b commit 1a406d0
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 1a406d0

Please sign in to comment.