Steadybit logoResilience Hub
Try SteadybitGitHub icon
Steadybit logoResilience Hub

K6

Load Test

Load Test

Runs a K6 load test.
Install now

K6

Runs a K6 load test.
Load Test

Load Test

Install now

K6

Load Test

Load Test

Runs a K6 load test.
Install now

K6

Runs a K6 load test.
Load Test

Load Test

Install now
Go back to list
K6 loadtest within the experiment editor.K6 loadtest within the experiment editor.

Introduction

K6 is a developer-centric, free and open-source load testing tool built for making performance testing a productive and enjoyable experience. You can integrate the execution of K6 load tests directly into your experiments.

Details

To use K6 you need to upload your K6-Test-Script. This can be done simply by adding a step of type "Loadtest", choose "K6" as Loadtest-Type and use the provided File-Upload.

Within the K6 load test you have access to your provided parameters as environment variables. You can use them in the script via e.g. ${__ENV.DURATION} as shown in our basic example below. The parameter DURATION is always accessible in your script, it contains the estimated total duration of your experiment, based on the duration of the other steps in seconds.

If you don't know where to start, feel free to use our example. It is a very basic script and will just perform some HTTP-Calls on a specified endpoint.

Example K6 Loadtest script

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

export let options = {
  scenarios: {
    default_test: {
      executor: 'constant-vus',
      vus: `${__ENV.VUS}`,
      duration: `${__ENV.DURATION}s`,
    },
  },
};

export default function () {
  let response = http.get(`${__ENV.TARGETURL}`);
  check(response, { 'status was 200': r => r.status == 200 });
  sleep(1);
}

Parameters

ParameterEnvironment VariableDescriptionDefault
DurationDURATIONHow long should the load test run?inherited from experiment duration
Virtual UsersVUSHow many virtual users should be started?
Target URLTARGETURLWhich url should be targeted?

Report

After execution, the K6 report /tmp/report/report.json will be transferred to the platform.

Homepage
docs.steadybit.com/quick-start/set-up-agents
MaintainerSteadybit
Start using Steadybit for free

Steadybit is free for personal use. Start your journey towards reliability!

Are you unsure where to begin?

No worries, our reliability experts are here to help: book a demo with them!

Steadybit logoResilience Hub
Try Steadybit
HubActionsTargetsExtensionsRecipes
© 2023 Steadybit GmbH. All rights reserved.
Twitter iconLinkedIn iconGitHub icon