forked from alphabin1/performance-testing-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
users.js
36 lines (30 loc) · 908 Bytes
/
users.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 } from 'k6';
export const options = {
stages: [
{ duration: '1s', target: 0},
{ duration: '1s', target: 50}
],
thresholds:{
'iteration_duration': ['p(90) < 500'],
'http_req_duration' : ['max< 350'],
},
}
export default () => {
group ('get customers ' , function () {
let response = http.get("http://localhost/customers");
check(response, {
'is status code 200': (r) => r.status === 200,
});
});
group ('get card' , function () {
let response = http.get("http://localhost/cards");
check(response, {
'is status code 200': (r) => r.status === 200,
});
});
group ('get cart' , function (){
let response = http.get("http://localhost/cart");
check(response,{'is status code 200':(r) => r.status === 200,});
});
}