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
2
votes
1 answer

How to run test in sequential order in loadimpact?

We have 2 APIs which we wanted to test with load impact and the second API is the so-called dynamic target which is built upon the basis of data we get from the response of the first API. Hence, We want to run this test sequentially. How can we…
mohit
  • 2,325
  • 23
  • 48
2
votes
1 answer

k6 simulate logged in wordpress user

I am trying to simulate a logged in user activity for stress testing a WordPress site using this script: import http from "k6/http"; import { sleep } from "k6"; export default function() { var url = "http://example.com.com/wp-login.php"; var…
2
votes
1 answer

Unique data in each VU thread in k6 / shared state between VUs

Is it possible to get a global counter shared across VU threads in k6? e.g. for user registration where email address must be unique, I'm using "user" + i + "@example.com" ... Currently using a global variable: let i = 1 in global namespace.…
Ragnar
  • 1,122
  • 1
  • 9
  • 16
1
vote
1 answer

How to log in to Liferay programmatically and avoid [JSONAction:92] User ... must be authenticated errors

I'm attempting to construct a k6 load test to exercise a WebSocket endpoint running in Liferay 7.1. We're having issues with our WebSocket connections in production, so I'm trying to emulate the sign in and WebSocket initialization that occurs in…
shawmanz32na
  • 1,260
  • 3
  • 15
  • 19
1
vote
0 answers

How can I configure SSL for a k6 client using a self-signed certificate on Redhat Linux?

I have tried to follow the documentation and used following code snippet: tlsAuth: [ { domains: ['example.com'], cert: open('./mycert.pem'), key: open('./mycert-key.pem'), } However, I am having difficulty getting this to…
msumit
  • 11
  • 2
1
vote
1 answer

How to send multiple requests for a duration in k6?

Hi I am having the following scenario I have to two end points. i want to send 100 requests to the first end point for a duration of 60 seconds. After 30 seconds I want to hit the second endpoint with 150 requests for 30 seconds. any idea how to…
Starbucks Admin
  • 585
  • 1
  • 8
  • 21
1
vote
1 answer

Can I run python script with test using k6 tool?

I have a script in python with 1 test in it. The test calls other functions from different class in the project which generate differeydata each time to be send through the post request in the test. I want to run this test using the k6 tool, for 5…
123josh123
  • 147
  • 9
1
vote
1 answer

Kubernetes loadbalancing / Performance testing

I am running load tests using K6 as a tool. I am sending 1000 requests per second to a .NET API (without database) that I deployed in Kubernetes. Sending this many requests impacts the performance of my application. This is noticeable in the request…
Son Of Earth
  • 13
  • 1
  • 1
  • 5
1
vote
0 answers

How do you use custom IPv4 headers in K6?

Is it possible to use custom IPv4 headers in the K6 load testing framework from Grafana? For example, I'd like to be able to set the options field in the IPv4 header or change the TTL. I've looked into using Scapy and Gopacket, but a higher level…
grungy
  • 11
  • 1
1
vote
0 answers

How to handle k6 Trend value where 2 values get pushed at same timestamp

I have a scenario in K6 where I get 2 values at the same timestamp from datadog. The first value is an incorrect spike. The second one is the correct value which I need. I use K6 Trend to collect the values from Datadog. It collects it as 2…
Sonali Agrawal
  • 303
  • 4
  • 14
1
vote
1 answer

k6 parse user ids from S3 and execute 1 id per vu

I downloaded data from S3 via S3Client. Below is the…
Zhang
  • 39
  • 1
  • 6
1
vote
1 answer

Different time zone support in K6

Im trying to get the current time in Europe/London time zone using K6. const date = new Date(); console.log( date.toLocaleString('en-GB', { timeZone: 'Europe/London', }), ); But it looks like it ignores the locale and gives me my…
Ushani
  • 1,199
  • 12
  • 28
1
vote
0 answers

I tried installing k6 on Mac but it did not work

I tried installing k6 (load test) on Mac based on the documentation: https://k6.io/docs/getting-started/installation/#macos brew install k6 but I get the error: ==> Searching for similarly named formulae... Error: No similarly named formulae…
ebanster
  • 886
  • 1
  • 12
  • 29
1
vote
0 answers

K6: Dependant Scenarios

Is it possible to run scenarios in series, with dependancy? I.E Output of one scenario as input to another? From the documentation, it seems like scenarios can be made somewhat serial with startTime? But not sure about dependent scenarios. Is this…
Vipin Menon
  • 2,892
  • 4
  • 20
  • 35
1
vote
0 answers

Which url do I use in a test script when using K6 in github

Im currently looking into K6 to stress test our api. For this I want to set up a github action to run a stress test before deploying to production. The issue is that in all guides I found for this, the user is using some url pointing to some webpage…