Skip to content

Commit 28f3bd1

Browse files
committed
feat: 성능 테스트 설정
1 parent 2366e76 commit 28f3bd1

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Performance Test/health-test.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import http from 'k6/http';
2+
import { check, sleep } from 'k6';
3+
4+
const baseUrl = __ENV.K6_TEST_URL;
5+
const targetUrl = `${baseUrl.replace(/\/$/, '')}/health-check`;
6+
7+
console.log(`[k6] 테스트 시작!!. Target URL: ${targetUrl}`);
8+
9+
export const options = {
10+
thresholds: {
11+
http_req_duration: ['p(95)<300'],
12+
http_req_failed: ['rate<0.01'],
13+
},
14+
};
15+
16+
export default function () {
17+
const res = http.get(targetUrl, { tags: { endpoint: 'health' } });
18+
check(res, {
19+
'status is 200': (r) => r.status === 200,
20+
});
21+
sleep(1);
22+
}

0 commit comments

Comments
 (0)