feat: Added k6 performance tests

This commit is contained in:
2026-05-10 22:00:24 +02:00
commit 5f7dd2e281
9 changed files with 290 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
import { chessUserJourney } from '../scenarios/chessUserScenario.js';
import { thresholds } from '../config.js';
const START_USERS = parseInt(__ENV.START_USERS || '2', 10);
const USERS_INCREMENT = parseInt(__ENV.USERS_INCREMENT || '2', 10);
const STEPS = parseInt(__ENV.STEPS || '2', 10);
const STEP_DURATION = parseInt(__ENV.STEP_DURATION || '30', 10);
const RAMP_DURATION = parseInt(__ENV.RAMP_DURATION || '10', 10);
const stages = [];
let currentUsers = START_USERS;
for (let i = 0; i < STEPS; i++) {
// Ramp up
stages.push({
duration: `${RAMP_DURATION}s`,
target: currentUsers,
});
// Hold at level
stages.push({
duration: `${STEP_DURATION}s`,
target: currentUsers,
});
currentUsers += USERS_INCREMENT;
}
export const options = {
stages,
thresholds,
};
export default function () {
chessUserJourney();
}