diff --git a/.github/workflows/k6.yml b/.github/workflows/k6.yml index faf4e3fe0b3..87a846fb3e9 100644 --- a/.github/workflows/k6.yml +++ b/.github/workflows/k6.yml @@ -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 diff --git a/packages/js/k6/src/frontend/scenarios.ts b/packages/js/k6/src/frontend/scenarios.ts index 5e5642deece..09cece59527 100644 --- a/packages/js/k6/src/frontend/scenarios.ts +++ b/packages/js/k6/src/frontend/scenarios.ts @@ -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, } }