forked from ncats/pharos_frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
load_test.js
39 lines (35 loc) · 858 Bytes
/
load_test.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
const axios = require('axios');
const fs = require('fs');
const routes = fs.readFileSync('./routes.txt').toString().split('\n');
console.log(routes);
let count = 0;
async function load_test() {
while(true) {
await axios.get('http://localhost:4000/targets').then(res => {
console.log(res);
});
}
if (true) {
for (let i = 0; i < routes.length; i++) {
// console.log(routes[i]);
await axios.get('http://localhost:4000' + routes[i]).then(res => {
console.log('done ' + routes[i]);
}).catch(err => {
console.log('error on ' + count);
// console.log(err);
});
}
}
}
load_test();
// load_test();
// load_test();
// load_test();
// load_test();
// setInterval(() => {
// load_test();
// // load_test();
// // load_test();
// // load_test();
// // load_test();
// }, 10000);