mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
test: use faster variant for rss
PR-URL: https://github.com/nodejs/node/pull/36839 Refs: https://github.com/nodejs/node/pull/34291 Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
b40d35d649
commit
0243376cfc
|
|
@ -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) => {
|
||||
|
|
@ -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`);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user