-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstress_test.js
36 lines (28 loc) · 882 Bytes
/
stress_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
import http from 'k6/http';
import { check, group, sleep } from "k6";
import { Counter, Rate, Trend } from "k6/metrics";
const loginData = JSON.parse(open("./users.json")); // download the data file here: https://test.k6.io/static/examples/users.json
export let options = {
stages: [
// stress test
{ target: 900, duration: "10m" },
{ target: 900, duration: "10m" },
{ target: 0, duration: "5m" },
],
thresholds: {
"http_req_duration": ["p(98)<5000"],
"http_req_duration": ["p(95)<1500"],
},
};
export default function () {
const BASE_URL = 'https://test-api.k6.io'; // make sure this is not production
let responses = http.batch([
[
'GET',
`${BASE_URL}/public/crocodiles/`,
null,
{ tags: { name: 'PublicCrocs' } },
]
]);
sleep(1);
};