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
12
votes
5 answers

How to execute multiple k6 scripts via single command in loadimpact/k6?

As indicated in the official loadimpact/k6 documentation, we are able to execute a single k6 script as follows: k6 run ../tests/http_get.js How would I go about executing multiple script files in a single run? Specifically all scripts that reside…
101010110101
  • 1,940
  • 8
  • 31
  • 42
8
votes
1 answer

How do I allow insecure requests in k6s?

Having an application that runs with an insecure certificate results in an error from k6. time="2017-11-29T14:15:16Z" level=warning msg="Request Failed" error="Put https://xxxxxxx: x509: certificate signed by unknown authority"
HackToHell
  • 2,223
  • 5
  • 29
  • 44
7
votes
3 answers

dial tcp: getsockopt: connection refused on local testing

I have been using k6 for a couple of days to do load testing against and API in several different environments and chase down some bugs. Everything was going great, until suddenly it started failing locally. All requests result in the following…
Chris Barcroft
  • 562
  • 5
  • 12
6
votes
1 answer

Does the sleep function in k6 pause execution of all virtual users or just one user at a time?

I am new to using https://k6.io for load testing and was wondering about the behavior of the sleep function. Right now I have built a load test with multiple stages. In my default function, I have a number of requests (get and post) that get…
J99
  • 439
  • 5
  • 12
6
votes
1 answer

Errors shown by k6 when reaching a bigger number of virtual users

I'm evaluating k6 for my load testing needs. I've set up a basic load test and I'm currently trying to interpret the error messages and result values I get. Maybe someone can help me interpret what I'm seeing: If I crank up the VUS to about 300, I…
SebastianR
  • 1,683
  • 2
  • 17
  • 33
6
votes
2 answers

Downloading whole websites with k6

I'm currently evaluating whether k6 fits our load testing needs. We have a fairly traditional website architecture that uses Apache webservers with PHP und a MySQL database. Sending simple HTTP requests with k6 looks simple enough and I think we…
SebastianR
  • 1,683
  • 2
  • 17
  • 33
6
votes
1 answer

get permission denied when trying to k6 run a js file

I am trying to learn k6 and I started with its official documents. I tried the sample code in run document with both docker image and command-line. In the docker version it works fine: zeinab@ZiZi:~$ docker run -i loadimpact/k6 run -
Zeinab Abbasimazar
  • 9,835
  • 23
  • 82
  • 131
6
votes
2 answers

Using k6 on docker to test a localhosted site

I've got a app running on my computer in localhost:1235, and I'm trying to load test it. I installed k6 container for docker to test it, but of course from the nature of docker, my container has a different localhost. I'm trying to understand what…
Chiptus
  • 949
  • 9
  • 25
6
votes
2 answers

Is it possible to attach a debugger to k6 scripts?

I'm hoping to adopt k6 for load testing, but I'm having trouble developing scripts for it. My primary use case is to check at each request to see if I'm receiving the correct headers and content and would like to inspect the response with a…
Jason Lee
  • 93
  • 5
5
votes
1 answer

Generate an html report using k6 JSON output

Are there any plugins readily available which can generate html reports from K6 generated JSON output? I am trying to build a simple HTML report, but the generated output JSON is Invalid and cannot be parsed. Below is the JSON output from…
user1415083
  • 171
  • 2
  • 7
5
votes
2 answers

Can I pass custom command line arguments in loadimpact/k6 scripts?

As indicated in the official loadimpact/k6 documentation, we are able to execute k6 scripts as follows: k6 run github.com/loadimpact/k6/samples/http_get.js Is it possible to pass in custom command line arguments into a k6 test? For instance, let's…
101010110101
  • 1,940
  • 8
  • 31
  • 42
5
votes
2 answers

Constant load (x new requests per second)

Is there a way to to configure a performance test case with constant load (say, 3 new requests per second for 1 minute)? Other load testing libraries have this feature to set the request rate (e.g. Artillery.io, Vegeta). k6 has a way to set VUs, but…
user1010
  • 369
  • 1
  • 5
  • 18
4
votes
0 answers

How to handle a Bearer token in K6

As the title implies, as of now I'm facing some "doubts" regarding the Authorization with Bearer Token using K6 given that I'm receiving that Token as access_token from a getAuth method/service, right now I have the following: getAuthtoken.js import…
Esepee
  • 87
  • 1
  • 7
4
votes
2 answers

K6 Load Testing - How to make sequential id for entire test run

I have a api endpoint that each request need to be a different id , but how to make a id global and sequentual increment for each iteration shared for all VU, like a primary key on database table. Ex: request 1 : 400 VU :1 request 2 :…
J.Sperandio
  • 87
  • 1
  • 10
4
votes
2 answers

k6 Load Testing - How extract value from HTML response

I am using the k6 Load Testing Tool for the first time. I send a GET request and html is sent in the response. I then need to extract some values from this html. What is the best way of doing this in HTML? I have seen in the documentation that there…
Matt
  • 773
  • 2
  • 15
  • 30
1
2 3
21 22