doc: document directories in test directory
[platform/upstream/nodejs.git] / benchmark / http / simple.js
1 var common = require('../common.js');
2 var PORT = common.PORT;
3
4 var bench = common.createBenchmark(main, {
5   // unicode confuses ab on os x.
6   type: ['bytes', 'buffer'],
7   length: [4, 1024, 102400],
8   chunks: [0, 1, 4],  // chunks=0 means 'no chunked encoding'.
9   c: [50, 500]
10 });
11
12 function main(conf) {
13   process.env.PORT = PORT;
14   var spawn = require('child_process').spawn;
15   var server = require('../http_simple.js');
16   setTimeout(function() {
17     var path = '/' + conf.type + '/' + conf.length + '/' + conf.chunks;
18     var args = ['-d', '10s', '-t', 8, '-c', conf.c];
19
20     bench.http(path, args, function() {
21       server.close();
22     });
23   }, 2000);
24 }