feat(k6): add bespoke load test script
Some checks failed
CI Pipeline / Build and Test (push) Has been cancelled
Build and Publish TechDocs / build-and-publish (push) Has been cancelled

This commit is contained in:
2026-03-23 17:40:42 +00:00
parent ca5e90b0ba
commit 085c5edfef

35
k6/load-test.js Normal file
View File

@@ -0,0 +1,35 @@
import http from 'k6/http';
import { check, sleep, group } from 'k6';
export const options = {
scenarios: {
load_test: {
executor: 'ramping-vus',
startVUs: 0,
stages: [
{ duration: ''10s'', target: 10 },
{ duration: ''30s'', target: 10 },
{ duration: '5s', target: 0 },
],
},
},
thresholds: {
http_req_duration: ['p(95)<500'],
http_req_failed: ['rate<0.01'],
},
};
const BASE_URL = 'http://vote.demo-apps.svc.cluster.local:80';
export default function () {
group('Main Page', () => {
const res = http.get(`${BASE_URL}/`);
check(res, {
'status is 200': (r) => r.status === 200,
'response time < 500ms': (r) => r.timings.duration < 500,
'body contains HTML': (r) => r.body.includes('<!DOCTYPE html>'),
});
});
sleep(0.5);
}