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

Method create

benchmark/_http-benchmarkers.js:69–85  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

67 }
68
69 create(options) {
70 const duration = typeof options.duration === 'number' ?
71 Math.max(options.duration, 1) :
72 options.duration;
73 const scheme = options.scheme || 'http';
74 const args = [
75 '-d', duration,
76 '-c', options.connections,
77 '-t', Math.min(options.connections, require('os').availableParallelism() || 8),
78 `${scheme}://127.0.0.1:${options.port}${options.path}`,
79 ];
80 for (const field in options.headers) {
81 args.push('-H', `${field}: ${options.headers[field]}`);
82 }
83 const child = child_process.spawn(this.executable, args);
84 return child;
85 }
86
87 processResults(output) {
88 const throughputRe = /Requests\/sec:[ \t]+([0-9.]+)/;

Callers 4

domain-fn-args.jsFile · 0.45

Calls 4

requireFunction · 0.50
maxMethod · 0.45
minMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected