-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
47 lines (38 loc) · 1.03 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* jshint node:true */
var argv = require('yargs').argv;
var orbweaver = require('./lib/orbweaver.js');
var lodash = require('lodash');
var http = require('http');
var _ = require('lodash');
var root = argv._[0];
if (!root) {
usage();
}
var options = {
ignoreStatic: argv['ignore-static'],
ignoreExtensions: argv['ignore-extensions'],
ignore: argv['ignore'],
parallel: argv['parallel'],
timeout: argv['timeout'],
limit: argv['limit'],
random: argv['random'],
interval: argv['interval'],
metrics: argv['metrics']
};
var users = argv.users || 1;
if (users > 5) {
// Should look like separate machines
http.globalAgent.maxSockets = users;
}
var i;
for (i = 0; (i < users); i++) {
var _options = _.clone(options);
_options.id = i;
orbweaver(root, _options, function() {
console.log('* session ended');
});
}
function usage() {
console.log('Usage: orbweaver http://example.com [--parallel=6] [--ignore-static] [--ignore-extensions=gif,jpg,png,js,css] [--ignore=regexp] [--timeout=60000]');
process.exit(1);
}