forked from mantasdev225/defi_v1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathperformance.test.js
45 lines (37 loc) · 1.04 KB
/
performance.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
39
40
41
42
43
44
45
const axios = require("axios");
const { chainCoins } = require("./utils/constant");
const N = 1;
async function tt(url) {
const f = async () => {
const r = [];
for (const chain in chainCoins) {
const response = await axios.post(url);
r.push(response.data.length);
}
return r;
};
const arr = [];
for (let i = 0; i < N; i++) {
arr.push(f());
}
const res = await Promise.all(arr);
res.forEach((item) => console.log(item));
}
describe("Performance", () => {
describe("nelify", () => {
test("call request", async () => {
console.log("==================================================");
await tt(
`https://defireturn.herokuapp.com/wallet/0xf8aae8d5dd1d7697a4ec6f561737e68a2ab8539e`
);
}, 1200000);
});
describe("server", () => {
test("call request", async () => {
console.log("==================================================");
await tt(
"http://45.82.85.36/api/wallet/0xf8aae8d5dd1d7697a4ec6f561737e68a2ab8539e"
);
}, 1200000);
});
});