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

Function main

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

Source from the content-addressed store, hash-verified

18});
19
20function main({ len, n, c, duration }) {
21 const http = require('http');
22 const chunk = Buffer.alloc(len, '8');
23
24 const server = http.createServer((req, res) => {
25 function send(left) {
26 if (left === 0) return res.end();
27 res.write(chunk);
28 setTimeout(() => {
29 send(left - 1);
30 }, 0);
31 }
32 send(n);
33 });
34
35 server.listen(0, () => {
36 bench.http({
37 connections: c,
38 duration,
39 port: server.address().port,
40 }, () => {
41 server.close();
42 });
43 });
44}

Callers

nothing calls this directly

Calls 7

allocMethod · 0.80
listenMethod · 0.80
httpMethod · 0.80
sendFunction · 0.70
addressMethod · 0.65
closeMethod · 0.65
requireFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…