Questions tagged [k6]

k6 is a backend infrastructure load testing tool written in Go which runs load tests written in JavaScript.

k6 is an open source performance analysis tool for testing backend infrastructure load.

k6 itself is written in Go and runs load test scripts implemented in JavaScript with support for at least ES5.1. Some newer features are also supported through Babel. k6, formerly loadimpact, is owned by Grafana Labs.

k6 supports a variety of common load testing requirements:

  • Scenarios
  • Open and closed workload models
  • (Custom) metrics
  • Thresholds
  • Different protocols, including HTTP, WebSocket, and gRPC
325 questions
1
vote
0 answers

k6 Load Testing: Pause a ramping-vus test execution then resume it by terminal command

As I was checking, k6 provides load testers to pause/resume a live running test (as per docu: https://k6.io/blog/how-to-control-a-live-k6-test/) Please see my set up. export const options = { ext: { loadimpact: { projectID: 1234, …
Lars
  • 51
  • 1
  • 8
1
vote
1 answer

k6 postman - Request tags not added to postman test

In my postman-to-k6 converted k6 script, I have a request level tag which I use for the api request name. postman[Request]({ name: "Create Account", id: "ce390940-d07a-485a-8796-298708c4a720", method: "POST", address: "REDACTED", data: '{ …
1
vote
0 answers

How to have unique data row from a CSV file to be used/assigned for each VU only in k6 Load Testing

My set up is this: CSV File: -201 rows with different values/data each row. Actual Load Test File: *201 VUs *Peak Load Stages: 1m=201VUs, 3m=201VUs, 1m=0 VUs. *No fixed Iteration. *Duration is 5 minutes My goal: I want each VUs to have its…
Lars
  • 51
  • 1
  • 8
1
vote
2 answers

K6 - iterate over array, but not for each VU

I am working on a script to test my infra using k6. I would like each VU be assigned to a previous known id obtained from an existing array and that VU execute the instructions from the default function only once at the time the VU is created. How…
Carlos Ost
  • 492
  • 7
  • 22
1
vote
2 answers

Use k6 to just execute X number of requests

Is there a way to execute X number of requests? I've played around with iterations and virtual users but they seem to require a duration being set when I don't want to set a duration just execute X number of requests per user. I don't want to ramp…
Jon
  • 38,814
  • 81
  • 233
  • 382
1
vote
0 answers

k6 metrics to influx for grafana

Scenario: running a k6 scenario with multiple api calls. Need to populate a dashboard in grafana for results from k6 which shows count status code by api call, need a graphs plotting average time taken by each api in scenario during the k6…
1
vote
1 answer

Why are only top-level requests proxied when configuring http clients such as postman or K6

The Goal Run integration tests but stub sub-requests to a specific domain that occur within the API code itself Ideally, do this via docker-compose because I want to be able to run this in Circle CI or Jenkins The attempt I'm using the mockttp…
punkrockbuddyholly
  • 9,675
  • 7
  • 36
  • 69
1
vote
1 answer

Why does the built-in metric "vus" in .json output not reflect the console output?

In the console output of K6 you can easily see how many VUs are currently active. See picture In the .json output there is a metric "vus" and a metric "vus_max". I would expect "vus" to reflect the number of currently active virtual users. However,…
Jessy
  • 11
  • 3
1
vote
1 answer

K6 Request an API sequentially based on VU Id

I am making a load testing program using K6, JavaScript in which I want to request an API sequentially based on VU id. For example, let suppose I have 5 different payloads and 5 VU one for each payload. I want my program to run such as, for the 1st…
1
vote
1 answer

SyntaxError when using yield in K6

I am trying to use javascript generator and yield in k6. When I try to run the script I get this error: SyntaxError: ...yield is a reserved word Is it possible to use yield in k6?
Chobicus
  • 2,024
  • 2
  • 17
  • 26
1
vote
1 answer

Running K6 with docker-compose creating a new container instead start an old one

I using K6 + InfluxDB + Grafana with docker-compose, but i got a problem. After create and start new containers using docker-compose up -d grafana influxdb when i run k6 using docker-compose run k6 run a new container is created instead start an old…
1
vote
1 answer

How to debug k6 testing script in Visual Studio Code?

When trying to launch Visual Studio Code in debugging mode, to inspect a k6 testing script, I get the following message: Uncaught Error: Cannot find module 'k6'. I'm writing the test scripts in TypeScript and I'm using NodeJS + Webpack +…
Felipe Calderano
  • 161
  • 1
  • 10
1
vote
0 answers

K6 script failing in azure devops

Setup We are using K6 tool for Load testing our API. Locally scripts work perfectly fine with virtual users up to 50 problem statement While running the same script in Azure devops using K6 task and virtual user 15 for duration 60s most of the…
chandan prasad
  • 111
  • 1
  • 10
1
vote
1 answer

K6: Authorization in the Test Life Cycle

I have been reading through the K6 documentation and am struggling to find a way to conform a K6 script to meet my needs. The scenario I imagine in my head: // 1. init code export function setup() { // 2. setup code // The VU would get setup…
qbtDtBscsW
  • 43
  • 5
1
vote
1 answer

K6: How to Count error Bad Handshake (Websocket)

Currently i’m working on the loadtest for websocket, then I got so much errors like this Then i would to count how many errors that occurs, and provide it on the report. And I tried this method: let errHandshake = new…
chigarow
  • 53
  • 7