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
0
votes
0 answers

Why latency decreases when load increases?

I’ve been doing some really basic test with k6 on different http servers, and I’ve noticed that when I increase the load (in request per second), the latency (http_duration_req metric) decrease and it seems quite odd. Two scenarios for…
fullfox
  • 1
  • 1
0
votes
1 answer

Validating Oauth credentials in K6 load test script

I am trying to grab a token and pass it into the GET requests. The below works, but it's grabbing a token every single time a request runs. Ideally I want to grab it once per run and pass it to the requests. Any ideas on how to make that happen…
JD2775
  • 3,658
  • 7
  • 30
  • 52
0
votes
1 answer

k6 - storing data between setup and default functions

I want to store an id in a setup section, what I got when I upload a file for an endpoint, and after that, I need to get back the uploaded element in the default section multiple times. I tried to use a helper function with a setter and getter but…
0
votes
1 answer

Any leads on using k6 for temporal workflows load testing ? Any references if we can achieve it

Can we use k6 to test temporal workflows load testing? Is there any references which would be helpful
0
votes
1 answer

`ReferenceError: URL is not defined` in the AWS client-cognito-identity-provider javascript library during performance testing with k6

I perform a performance testing of the application with an endpoint that should have Authorization. Authorization to this application was done by the AWS Cognito tool. The tool that I use for performance testing is k6 with Webpack. But when I try to…
Tomash Gombosh
  • 143
  • 1
  • 3
  • 18
0
votes
1 answer

load test using k6 with fixed request rate

trying to run k6 performance test cases by using the following scenario's how to hit x amount of API per min for example: Produce 500 messages per minute → Check how API behaves It should be same, next time we run the test case.
0
votes
1 answer

k6 - create custom resource using go client

Anyone know how to create a Custom Resource using go-client. basically equivalent of kubectl apply -f 'yaml path' apiVersion: k6.io/v1alpha1 kind: K6 metadata: name: k6-sample spec: parallelism: 1 #arguments: --out statsd #cleanup: post …
0
votes
1 answer

Issue with making constant request in k6

I have situation where I need to make constant request for a certain period of time, say 5 requests in every 1 second for 30 seconds. I used the constant-arrival-rate to achieve this but I don’t see the expectations are met while using it. I am…
Joz
  • 35
  • 4
0
votes
1 answer

k6 reports with today date

I have my tests in k6 - performance tests. I need add today date to html report: import http from 'k6/http'; import { sleep } from 'k6'; import { htmlReport } from "https://raw.githubusercontent.com/benc-uk/k6-reporter/main/dist/bundle.js"; import…
Jan
  • 1
0
votes
2 answers

How to get files and folders from a path in k6?

How to get the list of files and folders from a path? And is it possible to apply RegEx when searching?
eSPiYa
  • 882
  • 1
  • 12
  • 29
0
votes
0 answers

Highlighted message in command prompt when running test on K6

I'm studying the execution of performance tests using K6. Doing the Postman login test scenario, the result was positive: Running the test with Postman I exported the Postman collection and did the file conversion for K6 to recognize it. Then, when…
Joseferson
  • 7
  • 1
  • 3
0
votes
0 answers

Rotate proxy in k6 script

I know you can set a single proxy with an environment variable to a K6 script like this: HTTP_PROXY="user:pass@x.x.x.x.:yyyyy" k6 run script.js I also tried changing the value (randomly) of HTTP_PROXY inside the script and it changes successfully…
0_o
  • 570
  • 6
  • 18
0
votes
1 answer

k6 default output in docker image is too big

I'm running a k6 docker image with some tests. However, the output that I get is very different from what I would expect. Instead of the usual output with just summary, I get those annoying running and default prints. How can I show just the end of…
An old man in the sea.
  • 1,169
  • 1
  • 13
  • 30
0
votes
1 answer

How k6 sending files in field

I reference this python send files to send file. And this is my python frontend code. (I have a backend to receive the files["img"]) import requests host = "http://example.org:5000" with open("./test.png", "rb") as f: r = requests.get(host,…
eeeXun
  • 1
  • 1
0
votes
1 answer

K6 Websocket disconnects after 15 seconds

I’m having trouble running a K6 websocket for more than 15 seconds on 1 VU. The code is from the documentation: const socketUrl = `${resBody.url.replace('https', 'wss')}&id=${connectionId}`; res = ws.connect(socketUrl, params, function (socket) { …
Dmitry Klimkin
  • 445
  • 3
  • 15