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

Function main

benchmark/http/cluster.js:20–44  ·  view source on GitHub ↗
({ type, len, c, duration })

Source from the content-addressed store, hash-verified

18}
19
20function main({ type, len, c, duration }) {
21 process.env.PORT = PORT;
22 let workers = 0;
23 const w1 = cluster.fork();
24 const w2 = cluster.fork();
25
26 cluster.on('listening', () => {
27 workers++;
28 if (workers < 2)
29 return;
30
31 setImmediate(() => {
32 const path = `/${type}/${len}`;
33
34 bench.http({
35 path: path,
36 connections: c,
37 duration,
38 }, () => {
39 w1.destroy();
40 w2.destroy();
41 });
42 });
43 });
44}

Callers

nothing calls this directly

Calls 4

httpMethod · 0.80
setImmediateFunction · 0.50
onMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…