forked from jysim3/pointr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
loadtester.js
33 lines (32 loc) · 1.01 KB
/
loadtester.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
import http from 'k6/http';
import {check} from 'k6';
let options = {
duration: '600s',
};
// SEE https://k6.io/docs/testing-guides/api-load-testing to use this script
// Installation:: https://k6.io/docs/getting-started/installation
const SLEEP_DURATION = 0.1;
export default function() {
var url = 'https://pointr.live/api/auth/register';
const id = (__VU +""+ __ITER).slice(-2);
var payload = JSON.stringify({
zID: "z50200" + id,
firstName: "User",
lastName: "One",
password: "asdfjkl;",
commencementYear: 2020,
studentType: "international",
degreeType: "undergraduate",
isArc: true
});
var params = {
headers: {
'Content-Type': 'application/json',
},
};
let res = http.post(url, payload, params);
console.log(res.body)
check(res, {
'status was 200': r => r.status == 200,
})
}