Skip to main content
appkiro.com

k6 Load-Test Script Generator

Generate a reviewable k6 JavaScript starting script from scenarios, stages, HTTP requests, checks, variables, data files, thresholds, and sleep settings.

Steady, realistic traffic to validate everyday performance.

Stages (ramp-up pattern)
Define how VUs increase or decrease over time.
HTTP requests
Define the requests your test will execute.
#1
#2JSON
#3
#4JSON
Checks (assertions)
Validate responses to ensure correct behavior.
Test data
Inline variables (compiled as const at the top of the script) and optional CSV files.

Variables (inlined into requests)

CSV data files

No CSV files declared. Add one if your test reads tabular data via SharedArray.

Options & thresholds
Pass/fail criteria and pacing.
VUs over time
Live preview of the ramp pattern from your stages.

VUs over time

02550751000m6m12m18m24m30m
import http from 'k6/http';
import { check, sleep } from 'k6';

// --- Generated k6 script. URLs, headers, and payloads are inlined. ---
export const options = {
  stages: [
    { duration: '2m', target: 10 },
    { duration: '3m', target: 50 },
    { duration: '5m', target: 50 },
    { duration: '5m', target: 100 },
    { duration: '10m', target: 100 },
    { duration: '5m', target: 0 },
  ],
  thresholds: {
    http_req_failed: ['rate<0.01'],
    http_req_duration: ['p(95)<500'],
    checks: ['rate>0.95'],
  },
};

export default function () {
  // 1. GET https://example.com/
  let res = http.get('https://example.com/');
  check(res, {
    'Status code is 200': (r) => res.status === 200,
    'Response time < 500ms': (r) => res.timings.duration < 500,
    'Response body contains "success"': (r) => res.body && res.body.includes("success"),
  });
  sleep(1);

  // 2. POST https://example.com/api/login
  res = http.post('https://example.com/api/login', '{\n  "username": "[email protected]",\n  "password": "password123"\n}');
  check(res, {
    'Status code is 200': (r) => res.status === 200,
    'Response time < 500ms': (r) => res.timings.duration < 500,
    'Response body contains "success"': (r) => res.body && res.body.includes("success"),
  });
  sleep(1);

  // 3. GET https://example.com/api/users
  res = http.get('https://example.com/api/users', { headers: {
    'Authorization': 'Bearer your_token_here',
  } });
  check(res, {
    'Status code is 200': (r) => res.status === 200,
    'Response time < 500ms': (r) => res.timings.duration < 500,
    'Response body contains "success"': (r) => res.body && res.body.includes("success"),
  });
  sleep(1);

  // 4. POST https://example.com/api/users
  res = http.post('https://example.com/api/users', '{\n  "name": "Alice"\n}', { headers: {
    'Authorization': 'Bearer your_token_here',
  } });
  check(res, {
    'Status code is 200': (r) => res.status === 200,
    'Response time < 500ms': (r) => res.timings.duration < 500,
    'Response body contains "success"': (r) => res.body && res.body.includes("success"),
  });
  sleep(1);

}
What you get
Complete k6 script (script.js)
Setup commands for your OS
Threshold-driven pass/fail
Starter script for review

What is k6 Load-Test Script Generator?

Generate a reviewable k6 JavaScript starting script from scenarios, stages, HTTP requests, checks, variables, data files, thresholds, and sleep settings. Base URL, load/stress/spike/soak/smoke scenario, stages or VUs, requests, checks, variables, optional cURL imports, CSV data, thresholds, and pacing. A downloadable k6 JavaScript file with configured scenarios, requests, checks, SharedArray CSV loading, thresholds, and sleeps.

Open the tool

What the tool does

  • Input: Base URL, load/stress/spike/soak/smoke scenario, stages or VUs, requests, checks, variables, optional cURL imports, CSV data, thresholds, and pacing.
  • Controls and processing: Scenario templates, stage/VU settings, request builder, cURL import, checks, variables, SharedArray CSV, failure-rate/p95/check thresholds, sleep, preview, and download.
  • Output: A downloadable k6 JavaScript file with configured scenarios, requests, checks, SharedArray CSV loading, thresholds, and sleeps.

How to use it

  1. Provide the input. Base URL, load/stress/spike/soak/smoke scenario, stages or VUs, requests, checks, variables, optional cURL imports, CSV data, thresholds, and pacing.
  2. Review the settings. Scenario templates, stage/VU settings, request builder, cURL import, checks, variables, SharedArray CSV, failure-rate/p95/check thresholds, sleep, preview, and download.
  3. Generate, inspect, and export. A downloadable k6 JavaScript file with configured scenarios, requests, checks, SharedArray CSV loading, thresholds, and sleeps.

Key features

  • Input: Base URL, load/stress/spike/soak/smoke scenario, stages or VUs, requests, checks, variables, optional cURL imports, CSV data, thresholds, and pacing.
  • Controls and processing: Scenario templates, stage/VU settings, request builder, cURL import, checks, variables, SharedArray CSV, failure-rate/p95/check thresholds, sleep, preview, and download.
  • Output: A downloadable k6 JavaScript file with configured scenarios, requests, checks, SharedArray CSV loading, thresholds, and sleeps.

Useful workflows

  • Generate a reviewable k6 JavaScript starting script from scenarios, stages, HTTP requests, checks, variables, data files, thresholds, and sleep settings.
  • Use it when you need this deliverable or diagnostic result: A downloadable k6 JavaScript file with configured scenarios, requests, checks, SharedArray CSV loading, thresholds, and sleeps.
  • Place it before the next verified workflow step: code review, a smoke run against an authorized non-production target, and gradual ramp-up with monitoring.

Limits and safety notes

  • The page generates code and does not run a load test. review authentication, data correlation, environment variables, request correctness, arrival model, thresholds, setup/teardown, k6 version, and target authorization before execution.

Troubleshooting

  • Start with one authorized request and the smallest scenario; confirm the target tool version, syntax, imports or dependencies, and data references in the real project.
  • Move credentials to environment variables or secret management, compile or lint the generated file, then run a low-load smoke test before any ramp-up.
  • The page generates code and does not run a load test. review authentication, data correlation, environment variables, request correctness, arrival model, thresholds, setup/teardown, k6 version, and target authorization before execution.

Frequently asked questions

What is k6 Load-Test Script Generator?

Generate a reviewable k6 JavaScript starting script from scenarios, stages, HTTP requests, checks, variables, data files, thresholds, and sleep settings.

How do I use k6 Load-Test Script Generator?

Provide the expected input, review the page settings, then verify the result before copying or downloading it. Expected output: A downloadable k6 JavaScript file with configured scenarios, requests, checks, SharedArray CSV loading, thresholds, and sleeps.

What input does it accept?

Base URL, load/stress/spike/soak/smoke scenario, stages or VUs, requests, checks, variables, optional cURL imports, CSV data, thresholds, and pacing.

What output does it produce?

A downloadable k6 JavaScript file with configured scenarios, requests, checks, SharedArray CSV loading, thresholds, and sleeps.

What are the limits?

The page generates code and does not run a load test. review authentication, data correlation, environment variables, request correctness, arrival model, thresholds, setup/teardown, k6 version, and target authorization before execution.

Related AppKiro tools

Start with a verified input

Generate the smallest script, review it in the target project, and run it only against an authorized non-production system before any controlled ramp-up.

Open the tool