-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
26 lines (20 loc) · 684 Bytes
/
Copy pathmain.js
File metadata and controls
26 lines (20 loc) · 684 Bytes
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
const config = require('./config.json');
const schema = require('./schema.json');
const DataStructure = require('./src/DataStructure');
const Shooter = require('./src/Shooter');
var count = 0;
const startRepeat = count => {
setTimeout(() => {
const obj = new DataStructure(schema, count);
count++;
Shooter.fire(obj.get(), config.target, () => {
if(count < config.loopCount){
startRepeat(count);
} else{
console.log(`${count} requisições realizadas!`);
}
});
}, config.delay);
};
console.log(`...disparando ${config.loopCount} ${config.target.method}s para: ${config.target.hostname}:${config.target.port}${config.target.path}`);
startRepeat(count);