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
2 answers

Is it possible to run Angular Cypress Test with K6?

We have a lot of cypress tests in our Angular Project. But we want to use k6 as our new main load testing tool. But also we want to keep our already written cypress tests. Is it possible to execute cypress tests within k6? e.g run k6 with 1000 VUs…
Tristate
  • 1,498
  • 2
  • 18
  • 38
2
votes
1 answer

How to create the following test scenario in k6?

My default function is just an http post request. I would like to test if my app is able to deal with the following scenario: 5 requests, per second, for 2 seconds 15 requests, per second, for 10 seconds 20 requests, per second, for 5 seconds I'm…
An old man in the sea.
  • 1,169
  • 1
  • 13
  • 30
2
votes
1 answer

How to wait first post issue and use while loop in k6 load test scripts?

I have two post request. This post request should run until the response is "createdIsCompleted" == false .I m taking createdIsCompleted response from second post isssue. So how can I run two requests in while loop. By the way, I have to wait first…
2
votes
1 answer

Understand how k6 manages at low level a large number of API call in a short period of time

I'm new with k6 and I'm sorry if I'm asking something naive. I'm trying to understand how that tool manage the network calls under the hood. Is it executing them at the max rate he can ? Is it queuing them based on the System Under Test's response…
lucataglia
  • 728
  • 5
  • 18
2
votes
0 answers

Is there any way to rerun the setup step every few minutes in a long duration test?

I am starting with K6, and I have created my first test scenario. The first thing I do in the "setup" stage is to get a token, and then in the test code, I use that token to perform operations. However, the token has an expiration of half an hour,…
2
votes
1 answer

Measure the duration of x amount of requests while using K6

I would like to use K6 in order to measure the time it takes to proces 1.000.000 requests (in total) by an API. Scenario Execute 1.000.000 (1 million in total) get requests by 50 concurrent users/theads, so every user/thread executes 20.000…
Odrai
  • 2,163
  • 2
  • 31
  • 62
2
votes
1 answer

Testing graphql subscriptions with k6

Is it possible to test graphql subscriptions using k6 framework? I tried to do it, but did not have much success. Also tried to do it with k6 websockets, but did not help. Thanks
2
votes
0 answers

K6 pass CA cert without password in http post request

I am working on the load testing scenario where I need to pass the CA certificate in the post request. I am using K6 tool for the testing purpose using JavaScript. The issue I am facing is that the CA certificate does not have any private key, and…
2
votes
2 answers

Include test run id in k6 metrics sent to Datadog

I use k6 on my local machine to perform load-testing as well as a Datadog agent to visualize the metrics in Datadog. I'd like to filter k6 metrics in Datadog as the tests aren't distinguishable. At this point the $test_run_id only shows * (refer to…
lysov
  • 160
  • 2
  • 14
2
votes
1 answer

How to include a JSON query in a batch request in k6

I have created a load test using k6 for my application and used a batch request to run all my urls in parallel, however, some of my urls are identical and only differ in their JSON query. If I was running the urls in parallel it would be POSTing or…
user12038919
2
votes
1 answer

Testing k6 groups with separate throughput

I am targeting 10x load for an API, this API contains 6 endpoints which should be under the test, but each endpoint has its own throughput which should be multiplied by 10. Now, I put all endpoints in one script file, but it doesn't make any sense…
Ahmed Negm
  • 865
  • 1
  • 11
  • 30
2
votes
1 answer

Suggested Configuration for executing K6 scripts on GiLab CI

I have been playing around with K6 performance tests on GitLab CI and I am wondering what is the best and recommended approach for setup. According to the K6 docs and sample project it defines the .gitlab-ci.yml as follows: before_script: - mkdir…
cdavid15
  • 413
  • 7
  • 14
2
votes
1 answer

Bundle npm module 'cheerio' in K6 test

I am trying to create some tests using K6 framework from LoadImpact, but I am struggelig with including external NPM module following the instructions on their documentation site. On loadImpacts documentations site they include a detailed example…
p.carlsen
  • 23
  • 1
  • 4
2
votes
1 answer

How do I set iterations for stage runs?

I am trying to setup a run in K6 with staged setup and rundown. I am trying to find out how to setup K6 so that it will start a new iteration of the run once the stages are complete. Do I simply include iterations in the stage block, or is there…
Steven Brooks
  • 31
  • 1
  • 2
2
votes
1 answer

How to authenticate to influxdb when using k6

I am using k6 for as a load testing tool and I want to write data to influxdb. It all works fine except I do not know how to send user credentials for influxdb. Example: ./k6.exe run --out "influxdb=http://localhost:8086/stresstest" script.js --vus…
Meliodas
  • 327
  • 2
  • 10
1 2
3
21 22