%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
'use strict';
const common = require('../common.js');
const PORT = common.PORT;
const cluster = require('cluster');
let bench;
if (cluster.isMaster) {
bench = common.createBenchmark(main, {
// Unicode confuses ab on os x.
type: ['bytes', 'buffer'],
len: [4, 1024, 102400],
c: [50, 500],
duration: 5,
});
} else {
const port = parseInt(process.env.PORT || PORT);
require('../fixtures/simple-http-server.js').listen(port);
}
function main({ type, len, c, duration }) {
process.env.PORT = PORT;
let workers = 0;
const w1 = cluster.fork();
const w2 = cluster.fork();
cluster.on('listening', () => {
workers++;
if (workers < 2)
return;
setImmediate(() => {
const path = `/${type}/${len}`;
bench.http({
path: path,
connections: c,
duration
}, () => {
w1.destroy();
w2.destroy();
});
});
});
}