Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
227 changes: 227 additions & 0 deletions test/k6/k6-output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@

/\ Grafana /‾‾/
/\ / \ |\ __ / /
/ \/ \ | |/ / / ‾‾\
/ \ | ( | (‾) |
/ __________ \ |_|\_\ \_____/

execution: local
script: test/k6/load-test.mjs
output: -

scenarios: (100.00%) 1 scenario, 50 max VUs, 1m30s max duration (incl. graceful stop):
* default: 50 looping VUs for 1m0s (gracefulStop: 30s)


running (0m01.0s), 50/50 VUs, 0 complete and 0 interrupted iterations
default [ 2% ] 50 VUs 0m01.0s/1m0s

running (0m02.0s), 50/50 VUs, 0 complete and 0 interrupted iterations
default [ 3% ] 50 VUs 0m02.0s/1m0s

running (0m03.0s), 50/50 VUs, 50 complete and 0 interrupted iterations
default [ 5% ] 50 VUs 0m03.0s/1m0s

running (0m04.0s), 50/50 VUs, 50 complete and 0 interrupted iterations
default [ 7% ] 50 VUs 0m04.0s/1m0s

running (0m05.0s), 50/50 VUs, 100 complete and 0 interrupted iterations
default [ 8% ] 50 VUs 0m05.0s/1m0s

running (0m06.0s), 50/50 VUs, 100 complete and 0 interrupted iterations
default [ 10% ] 50 VUs 0m06.0s/1m0s

running (0m07.0s), 50/50 VUs, 150 complete and 0 interrupted iterations
default [ 12% ] 50 VUs 0m07.0s/1m0s

running (0m08.0s), 50/50 VUs, 150 complete and 0 interrupted iterations
default [ 13% ] 50 VUs 0m08.0s/1m0s

running (0m09.0s), 50/50 VUs, 200 complete and 0 interrupted iterations
default [ 15% ] 50 VUs 0m09.0s/1m0s

Comment on lines +1 to +42
running (0m10.0s), 50/50 VUs, 200 complete and 0 interrupted iterations
default [ 17% ] 50 VUs 0m10.0s/1m0s

running (0m11.0s), 50/50 VUs, 250 complete and 0 interrupted iterations
default [ 18% ] 50 VUs 0m11.0s/1m0s

running (0m12.0s), 50/50 VUs, 250 complete and 0 interrupted iterations
default [ 20% ] 50 VUs 0m12.0s/1m0s

running (0m13.0s), 50/50 VUs, 300 complete and 0 interrupted iterations
default [ 22% ] 50 VUs 0m13.0s/1m0s

running (0m14.0s), 50/50 VUs, 302 complete and 0 interrupted iterations
default [ 23% ] 50 VUs 0m14.0s/1m0s

running (0m15.0s), 50/50 VUs, 352 complete and 0 interrupted iterations
default [ 25% ] 50 VUs 0m15.0s/1m0s

running (0m16.0s), 50/50 VUs, 352 complete and 0 interrupted iterations
default [ 27% ] 50 VUs 0m16.0s/1m0s

running (0m17.0s), 50/50 VUs, 402 complete and 0 interrupted iterations
default [ 28% ] 50 VUs 0m17.0s/1m0s

running (0m18.0s), 50/50 VUs, 422 complete and 0 interrupted iterations
default [ 30% ] 50 VUs 0m18.0s/1m0s

running (0m19.0s), 50/50 VUs, 465 complete and 0 interrupted iterations
default [ 32% ] 50 VUs 0m19.0s/1m0s

running (0m20.0s), 50/50 VUs, 506 complete and 0 interrupted iterations
default [ 33% ] 50 VUs 0m20.0s/1m0s

running (0m21.0s), 50/50 VUs, 523 complete and 0 interrupted iterations
default [ 35% ] 50 VUs 0m21.0s/1m0s

running (0m22.0s), 50/50 VUs, 573 complete and 0 interrupted iterations
default [ 37% ] 50 VUs 0m22.0s/1m0s

running (0m23.0s), 50/50 VUs, 573 complete and 0 interrupted iterations
default [ 38% ] 50 VUs 0m23.0s/1m0s

running (0m24.0s), 50/50 VUs, 623 complete and 0 interrupted iterations
default [ 40% ] 50 VUs 0m24.0s/1m0s

running (0m25.0s), 50/50 VUs, 673 complete and 0 interrupted iterations
default [ 42% ] 50 VUs 0m25.0s/1m0s

running (0m26.0s), 50/50 VUs, 687 complete and 0 interrupted iterations
default [ 43% ] 50 VUs 0m26.0s/1m0s

running (0m27.0s), 50/50 VUs, 737 complete and 0 interrupted iterations
default [ 45% ] 50 VUs 0m27.0s/1m0s

running (0m28.0s), 50/50 VUs, 737 complete and 0 interrupted iterations
default [ 47% ] 50 VUs 0m28.0s/1m0s

running (0m29.0s), 50/50 VUs, 787 complete and 0 interrupted iterations
default [ 48% ] 50 VUs 0m29.0s/1m0s

running (0m30.0s), 50/50 VUs, 837 complete and 0 interrupted iterations
default [ 50% ] 50 VUs 0m30.0s/1m0s

running (0m31.0s), 50/50 VUs, 852 complete and 0 interrupted iterations
default [ 52% ] 50 VUs 0m31.0s/1m0s

running (0m32.0s), 50/50 VUs, 889 complete and 0 interrupted iterations
default [ 53% ] 50 VUs 0m32.0s/1m0s

running (0m33.0s), 50/50 VUs, 939 complete and 0 interrupted iterations
default [ 55% ] 50 VUs 0m33.0s/1m0s

running (0m34.0s), 50/50 VUs, 961 complete and 0 interrupted iterations
default [ 57% ] 50 VUs 0m34.0s/1m0s

running (0m35.0s), 50/50 VUs, 1011 complete and 0 interrupted iterations
default [ 58% ] 50 VUs 0m35.0s/1m0s

running (0m36.0s), 50/50 VUs, 1011 complete and 0 interrupted iterations
default [ 60% ] 50 VUs 0m36.0s/1m0s

running (0m37.0s), 50/50 VUs, 1061 complete and 0 interrupted iterations
default [ 62% ] 50 VUs 0m37.0s/1m0s

running (0m38.0s), 50/50 VUs, 1080 complete and 0 interrupted iterations
default [ 63% ] 50 VUs 0m38.0s/1m0s

running (0m39.0s), 50/50 VUs, 1111 complete and 0 interrupted iterations
default [ 65% ] 50 VUs 0m39.0s/1m0s

running (0m40.0s), 50/50 VUs, 1161 complete and 0 interrupted iterations
default [ 67% ] 50 VUs 0m40.0s/1m0s

running (0m41.0s), 50/50 VUs, 1167 complete and 0 interrupted iterations
default [ 68% ] 50 VUs 0m41.0s/1m0s

running (0m42.0s), 50/50 VUs, 1217 complete and 0 interrupted iterations
default [ 70% ] 50 VUs 0m42.0s/1m0s

running (0m43.0s), 50/50 VUs, 1237 complete and 0 interrupted iterations
default [ 72% ] 50 VUs 0m43.0s/1m0s

running (0m44.0s), 50/50 VUs, 1287 complete and 0 interrupted iterations
default [ 73% ] 50 VUs 0m44.0s/1m0s

running (0m45.0s), 50/50 VUs, 1337 complete and 0 interrupted iterations
default [ 75% ] 50 VUs 0m45.0s/1m0s

running (0m46.0s), 50/50 VUs, 1337 complete and 0 interrupted iterations
default [ 77% ] 50 VUs 0m46.0s/1m0s

running (0m47.0s), 50/50 VUs, 1387 complete and 0 interrupted iterations
default [ 78% ] 50 VUs 0m47.0s/1m0s

running (0m48.0s), 50/50 VUs, 1420 complete and 0 interrupted iterations
default [ 80% ] 50 VUs 0m48.0s/1m0s

running (0m49.0s), 50/50 VUs, 1451 complete and 0 interrupted iterations
default [ 82% ] 50 VUs 0m49.0s/1m0s

running (0m50.0s), 50/50 VUs, 1489 complete and 0 interrupted iterations
default [ 83% ] 50 VUs 0m50.0s/1m0s

running (0m51.0s), 50/50 VUs, 1501 complete and 0 interrupted iterations
default [ 85% ] 50 VUs 0m51.0s/1m0s

running (0m52.0s), 50/50 VUs, 1551 complete and 0 interrupted iterations
default [ 87% ] 50 VUs 0m52.0s/1m0s

running (0m53.0s), 50/50 VUs, 1553 complete and 0 interrupted iterations
default [ 88% ] 50 VUs 0m53.0s/1m0s

running (0m54.0s), 50/50 VUs, 1603 complete and 0 interrupted iterations
default [ 90% ] 50 VUs 0m54.0s/1m0s

running (0m55.0s), 50/50 VUs, 1605 complete and 0 interrupted iterations
default [ 92% ] 50 VUs 0m55.0s/1m0s

running (0m56.0s), 50/50 VUs, 1655 complete and 0 interrupted iterations
default [ 93% ] 50 VUs 0m56.0s/1m0s

running (0m57.0s), 50/50 VUs, 1656 complete and 0 interrupted iterations
default [ 95% ] 50 VUs 0m57.0s/1m0s

running (0m58.0s), 50/50 VUs, 1706 complete and 0 interrupted iterations
default [ 97% ] 50 VUs 0m58.0s/1m0s

running (0m59.0s), 50/50 VUs, 1720 complete and 0 interrupted iterations
default [ 98% ] 50 VUs 0m59.0s/1m0s

running (1m00.0s), 50/50 VUs, 1770 complete and 0 interrupted iterations
default [ 100% ] 50 VUs 1m00.0s/1m0s

✓ homepage status is 200
✗ homepage loads in < 500ms
↳ 98% — ✓ 1800 / ✗ 20
✓ recent topics status is 200
Comment on lines +196 to +199
✓ recent topics loads in < 500ms
✓ popular topics status is 200
✓ categories status is 200
✓ categories loads in < 500ms
✓ api/recent status is 200
✓ api responds in < 300ms

checks.........................: 99.87% 16360 out of 16380
data_received..................: 634 MB 10 MB/s
data_sent......................: 1.5 MB 25 kB/s
http_req_blocked...............: avg=20.48µs min=1.27µs med=3.59µs max=5.52ms p(90)=6.13µs p(95)=7.44µs
http_req_connecting............: avg=1.2µs min=0s med=0s max=709.26µs p(90)=0s p(95)=0s
http_req_duration..............: avg=133.82ms min=4ms med=125.38ms max=1.18s p(90)=248.09ms p(95)=270.74ms
{ expected_response:true }...: avg=133.82ms min=4ms med=125.38ms max=1.18s p(90)=248.09ms p(95)=270.74ms
http_req_failed................: 0.00% 0 out of 9100
http_req_receiving.............: avg=12.8ms min=56.96µs med=8.59ms max=100.97ms p(90)=28.65ms p(95)=38.7ms
http_req_sending...............: avg=18.02µs min=3.87µs med=10.55µs max=4.56ms p(90)=18.79µs p(95)=25.83µs
http_req_tls_handshaking.......: avg=0s min=0s med=0s max=0s p(90)=0s p(95)=0s
http_req_waiting...............: avg=121ms min=3.66ms med=113.33ms max=1.16s p(90)=225.35ms p(95)=247.55ms
http_reqs......................: 9100 149.340899/s
iteration_duration.............: avg=1.67s min=1.04s med=1.63s max=2.78s p(90)=2s p(95)=2.05s
iterations.....................: 1820 29.86818/s
vus............................: 50 min=50 max=50
vus_max........................: 50 min=50 max=50


running (1m00.9s), 00/50 VUs, 1820 complete and 0 interrupted iterations
default ✓ [ 100% ] 50 VUs 1m0s
45 changes: 45 additions & 0 deletions test/k6/load-test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import http from 'k6/http';
import { sleep, check } from 'k6';

export const options = {
vus: 50, // 50 virtual users
duration: '60s', // run for 60 seconds
Comment on lines +4 to +6
};

export default function () {
// Test homepage
let res = http.get('http://localhost:4567/');
check(res, {
Comment on lines +10 to +12
'homepage status is 200': (r) => r.status === 200,
'homepage loads in < 500ms': (r) => r.timings.duration < 500,
});
Comment on lines +12 to +15

// Test recent topics
let recent = http.get('http://localhost:4567/recent');
check(recent, {
'recent topics status is 200': (r) => r.status === 200,
'recent topics loads in < 500ms': (r) => r.timings.duration < 500,
});

// Test popular topics
let popular = http.get('http://localhost:4567/popular');
check(popular, {
'popular topics status is 200': (r) => r.status === 200,
});

// Test categories page
let categories = http.get('http://localhost:4567/categories');
check(categories, {
'categories status is 200': (r) => r.status === 200,
'categories loads in < 500ms': (r) => r.timings.duration < 500,
});

// Test API endpoint
let api = http.get('http://localhost:4567/api/recent');
Comment on lines +11 to +38
check(api, {
'api/recent status is 200': (r) => r.status === 200,
'api responds in < 300ms': (r) => r.timings.duration < 300,
});

sleep(1);
}
Loading