MCPcopy Index your code
hub / github.com/nodejs/node / main

Function main

benchmark/process/getActiveResourcesInfo.js:16–45  ·  view source on GitHub ↗
({ handlesCount, requestsCount, timeoutsCount, immediatesCount, n })

Source from the content-addressed store, hash-verified

14});
15
16function main({ handlesCount, requestsCount, timeoutsCount, immediatesCount, n }) {
17 const server = createServer().listen();
18 const clients = [];
19 for (let i = 0; i < handlesCount; i++) {
20 clients.push(connect({ port: server.address().port }));
21 }
22
23 for (let i = 0; i < requestsCount; i++) {
24 open(__filename, 'r', () => {});
25 }
26
27 for (let i = 0; i < timeoutsCount; ++i) {
28 setTimeout(() => {}, 1);
29 }
30
31 for (let i = 0; i < immediatesCount; ++i) {
32 setImmediate(() => {});
33 }
34
35 bench.start();
36 for (let i = 0; i < n; ++i) {
37 process.getActiveResourcesInfo();
38 }
39 bench.end(n);
40
41 for (const client of clients) {
42 client.destroy();
43 }
44 server.close();
45}

Callers

nothing calls this directly

Calls 12

listenMethod · 0.80
addressMethod · 0.65
closeMethod · 0.65
createServerFunction · 0.50
connectFunction · 0.50
openFunction · 0.50
setTimeoutFunction · 0.50
setImmediateFunction · 0.50
pushMethod · 0.45
startMethod · 0.45
endMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…