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 "K6" 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.TARGETURL} as shown in our basic example below.

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.

Parameters

ParameterDescription
FileThe Load-Test-Script file
EnvironmentEnvironment Variables passed to the script

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);
}

Example Script Environment Variables

ParameterEnvironment VariableDescription
DurationDURATIONHow long should the load test run?
Virtual UsersVUSHow many virtual users should be started?
Target URLTARGETURLWhich url should be targeted?

Report

After execution, k6 metrics and logs are transferred to the platform.

Statistics
-Stars
Tags
k6
Load test
Homepage
hub.steadybit.com/extension/com.steadybit.extension_k6
License
MIT
MaintainerSteadybit


Start Using Steadybit Today

Get started with Steadybit, and you’ll get access to all of our features to discover the full power of Steadybit. Available for SaaS and on-prem!

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
© 2024 Steadybit GmbH. All rights reserved.
Twitter iconLinkedIn iconGitHub icon