-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathload-test-scripts.js
48 lines (40 loc) · 1.55 KB
/
load-test-scripts.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
48
import http from "k6/http";
import { sleep } from "k6";
// Test to check what happens if target number of users start pinging the server
// export let options = {
// vus: 10,
// duration: "1s",
// thresholds: {
// http_req_duration: ["p(95)<800", "p(99)<1500"],
// },
// };
export const options = {
stages: [
{ duration: "10m", target: 600 }, // simulate ramp-up of traffic from 1 to 100 users over 5 minutes.
{ duration: "10m", target: 600 }, // stay at 100 users for 10 minutes
{ duration: "5m", target: 0 }, // ramp-down to 0 users
],
thresholds: {
http_req_duration: ["p(99)<1500"], // 99% of requests must complete below 1.5s
},
};
const ADDRESS_LIST = [
"0xec96b3107b4709a345080a8e7a5767a32f1517b9",
"0x64e2f57777f8f9ca633a8958828f06dc17ab70df",
"0x945ff96b09b17aa4252ea10cd202685696554e9b",
"0x2394dfaf99270a3a6f7ba2122448932fa18c07fa",
"0x945ff96b09b17aa4252ea10cd202685696554e9b",
"0x9d9c9b3531ca645eb3edede6bfa99c5127ed4ed9",
"0x253eeb65380760aef78be62fe191ead9c221badb",
"0x1b49c73b73a4a35c68fa6be2bb7e7a6aa548d735",
"0xfdab8d7b82e016fb3082a03ae42a11b92b065660",
"0x6ca962df0524ff5df49740806fc5a899bdfbbabe",
];
export default function () {
const BASE_URL = "http://dev.jiffyscan.xyz";
const address = ADDRESS_LIST[parseInt(Math.random()*100%10)]
// console.log(address)
// http.get(`${BASE_URL}/api/v0/getAddressActivity?address=${address}`);
http.get(`${BASE_URL}/api/v0/getAddressActivityTest?address=${address}`);
sleep(0.3);
}