mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05: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:
1 parent
b40d35d649
commit
0243376cfc
1 file changed
+2
-2
@@ -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`);
|
||||
});
|
||||
Reference in new issue
Block a user