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

Function request

benchmark/_test-double-benchmarker.js:21–38  ·  view source on GitHub ↗
(res, client)

Source from the content-addressed store, hash-verified

19let throughput = 0;
20
21function request(res, client) {
22 res.resume();
23 res.on('error', () => {});
24 res.on('end', () => {
25 throughput++;
26 const [sec, nanosec] = process.hrtime(start);
27 const ms = sec * 1000 + nanosec / 1e6;
28 if (ms < duration * 1000) {
29 run();
30 } else {
31 console.log(JSON.stringify({ throughput }));
32 if (client) {
33 client.destroy();
34 process.exit(0);
35 }
36 }
37 });
38}
39
40function run() {
41 if (http.get) { // HTTP or HTTPS

Callers 1

runFunction · 0.70

Calls 6

runFunction · 0.70
resumeMethod · 0.65
onMethod · 0.45
logMethod · 0.45
destroyMethod · 0.45
exitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…