Skip to content

Commit 8267794

Browse files
committed
Added K6 Test for Microservice.
1 parent 4904a8d commit 8267794

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/k6/k6-test-microservice.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import {check, sleep, group} from "k6";
2+
import http from "k6/http";
3+
4+
export let options = {
5+
vus: 10,
6+
duration: '60s',
7+
batchPerHost: 4,
8+
insecureSkipTLSVerify: true,
9+
thresholds: {
10+
'http_req_duration{kind:html}': ['avg<=250', 'p(95)<500'],
11+
}
12+
};
13+
14+
export default function () {
15+
group("api", function () {
16+
check(http.get(`http://${__ENV.TARGET_HOSTNAME}:8080/api/ping`, {
17+
tags: {'kind': 'html'},
18+
}), {
19+
"status is 200": (res) => res.status === 200,
20+
});
21+
});
22+
sleep(1);
23+
}

0 commit comments

Comments
 (0)