Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify k6 load tests #5181

Merged
merged 15 commits into from
Nov 29, 2024
Merged
1 change: 1 addition & 0 deletions .github/workflows/k6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
just k6 ${{ inputs.namespace }} ${{ inputs.scenario }} \
${{ inputs.report && '-o cloud' || ''}} \
-e signing_secret="$K6_SIGNING_SECRET" \
-e scenario_duration="6m" \
-e service_url=${{ inputs.service_url }} \
-e text_summary=/tmp/k6-summary.txt

Expand Down
9 changes: 6 additions & 3 deletions packages/js/k6/src/frontend/scenarios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,17 @@ const createScenario = (
funcName: Action
): Scenario => {
return {
executor: "per-vu-iterations",
executor: "constant-arrival-rate",
env,
exec: funcName,
// k6 CLI flags do not allow override scenario options, so we need to add our own
// Ideally we would use default
// https://community.grafana.com/t/overriding-vus-individual-scenario/98923
vus: parseFloat(__ENV.scenario_vus) || 5,
iterations: parseFloat(__ENV.scenario_iterations) || 40,
timeUnit: __ENV.scenario_time_utin || "1m",
rate: parseInt(__ENV.scenario_rate) || 3,
duration: __ENV.scenario_duration || "4m",
preAllocatedVUs: 10,
maxVUs: 20,
}
}

Expand Down