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

Function main

benchmark/http/upgrade.js:21–36  ·  view source on GitHub ↗
({ n })

Source from the content-addressed store, hash-verified

19 '\r\n\r\n';
20
21function main({ n }) {
22 const server = require('../fixtures/simple-http-server.js')
23 .listen(0)
24 .on('listening', () => {
25 bench.start();
26 doBench(server.address(), n, () => {
27 bench.end(n);
28 server.close();
29 });
30 })
31 .on('upgrade', (req, socket, upgradeHead) => {
32 socket.resume();
33 socket.write(resData);
34 socket.end();
35 });
36}
37
38function doBench(address, count, done) {
39 if (count === 0) {

Callers

nothing calls this directly

Calls 10

doBenchFunction · 0.85
listenMethod · 0.80
addressMethod · 0.65
closeMethod · 0.65
resumeMethod · 0.65
requireFunction · 0.50
onMethod · 0.45
startMethod · 0.45
endMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…