File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import http from 'k6/http' ;
2+ import { sleep , check } from 'k6' ;
3+
4+ export const options = {
5+ stages : [
6+ { duration : '10s' , target : 10 } ,
7+ { duration : '5s' , target : 300 } ,
8+ { duration : '5s' , target : 1000 } ,
9+ ] ,
10+ thresholds : {
11+ http_req_failed : [ {
12+ threshold : 'rate<0.01' ,
13+ abortOnFail : true
14+ } ] ,
15+ http_req_duration : [ {
16+ threshold : 'p(95)<200' ,
17+ abortOnFail : true
18+ } ] ,
19+ }
20+ } ;
21+
22+ export default function ( ) {
23+ const res = http . get ( 'http://localhost:3000' ) ;
24+ check ( res , { 'Index OK' : ( r ) => r . status == 200 } )
25+ // const res = http.get('http://localhost:3000/catalog');
26+ // check(res, { 'Catalog OK': (r) => r.status == 200 });
27+ // const res = http.post('http://localhost:3000/add_to_basket');
28+ // check(res, { 'Basket CREATED': (r) => r.status == 201 })
29+ // const res = http.get('http://localhost:3000/checkout');
30+ // check(res, { 'Checkout OK': (r) => r.status == 200 });
31+ sleep ( 1 ) ;
32+ } ;
33+
You can’t perform that action at this time.
0 commit comments