champ-chatbot / tests /stress_tests /website_spike.js
qyle's picture
comments, profile info, user guid, gemini conservative/creative
006a3d6 verified
// This file aims to test a case where 80 users connect to the website at the same time.
import http from 'k6/http';
import { check } from 'k6';
export const options = {
scenarios: {
my_spike_test: {
executor: 'per-vu-iterations',
vus: 80, // 80 total users
iterations: 1, // Each user runs the script exactly once
maxDuration: '30s', // Maximum time allowed for all users to finish
},
},
};
export default function () {
const url = __ENV.URL;
// User lands on the site
const res = http.get(url);
check(res, { 'status is 200': (r) => r.status === 200 });
}
// http_req_duration..............: avg=1.28s min=628.16ms med=1.35s max=2.21s p(90)=1.7s p(95)=1.77s