Skip to content

Commit 2261667

Browse files
committed
Missing index page perftest
1 parent 4abea48 commit 2261667

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

test/perf/index.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+

0 commit comments

Comments
 (0)