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

Stress testing Postgres queries using K6 [No space on device error]

I'm trying to use k6 to stress test postgres queries. I am running postgres through docker and allocated following resources through settings : CPUs: 4, Memory: 10 GB, Swap: 2GB and Disk image size: 280 GB. When I did load testing for a query,…
cicada_
  • 325
  • 2
  • 9
1
vote
0 answers

K6 unique data per scenario

I am creating a test with two scenarios with different amount of users and ramp-up time. The idea is that each user shall login once to retrieve a SSO-cookie, that shall be used in subsequent requests. The user data is stored in one json-file and…
Mathog
  • 11
  • 2
1
vote
2 answers

Trying to understanding how VUs works k6

As shown in the image I ran only 2 VUs but it returned “100” complete. What would that 100 be? Number of scripts run or vus? So for every 1 VU I have 50 scripts running, is that it? https://i.stack.imgur.com/RUquH.png
Massallys
  • 11
  • 2
1
vote
1 answer

How to run curl commands with k6 docker image in gitlab yml

I want to run a curl request as a pre-request script for my K6 load tests. Here is my YML file: - loadtest-local image: name: ubuntu:latest loadtest-local: image: name: loadimpact/k6:latest entrypoint: [''] stage: loadtest-local …
1
vote
1 answer

K6 Use POST to login in

Ive been working with K6 recently and need to test my API, the login function needs a json in order to get the data but it does not get called on the run, heres my code for the script import http from 'k6/http'; import { sleep } from 'k6'; export…
Rogelio
  • 11
  • 2
1
vote
0 answers

Create a good k6 load test with graphql/subscription

After struggling against k6, with the help of the answers to my other question, i was able (i think) to test subscriptions with websocket. Now i'm trying to desing a good test. Our app is a Single Page App that mainly uses websocket subscriptions…
1
vote
1 answer

k6 redirects localhost to loopback

I'm on a Mac and I'm attempting to run my k6 script against http://localhost:4200 (angular app) locally. The angular app is running and I can access it via the browser and using curl. My k6 script has the base URL set to http://localhost:4200.…
a11smiles
  • 1,190
  • 1
  • 9
  • 21
1
vote
0 answers

Equivalent of Stomp.over in server side code

Is there a backend (nodejs, java, etc) equivalent of Stomp.over? I want to mimic the client side code like below: var socket = null; var stompClient = null; var connectCallback = function() { console.log(stompClient.ws._transport.url); //get…
kjoxiphucy
  • 37
  • 7
1
vote
1 answer

k6 how to restart testing service between scenarios

I am running a load test with k6, which tests my service with 6 scenarios. I am running my service with docker-compose and I want to restart my service between each scenario. I couldn't find a built-in method for this so I added a function to…
Sruthi CP
  • 341
  • 3
  • 13
1
vote
1 answer

How to query Firestore from a k6 script?

We're trying to query Firestore via a k6 script on a collection. In order to integrate the Firestore library we followed this guide on k6 website: https://k6.io/docs/using-k6/modules/#setting-up-the-bundler When we run our script we get this weird…
Ale TheFe
  • 1,540
  • 15
  • 43
1
vote
1 answer

How do we code k6 scripts that have dynamic number of stages?

How do we code k6 scripts that have dynamic number of stages? Essentially, If in one run I need to have 2 stages with parameters being constant or having arithmetic or geometric progression and in the second run I want to run it for 3/4/5.....n…
Aadarsh
  • 41
  • 6
1
vote
1 answer

error pops on run cmd: K6_PROMETHEUS_REMOTE_URL=http://172.21.2.29:9090/api/v1/write ./k6 run main_smoke_test.js -o output-prometheus-remote

I installed k6 v0.35.0, go 1.17.3, xk6@latest, Prometheus 2.32.0-beta.0, xk6-output-prometheus-remote@latest, and try to run k6 script, but I got below error: error image I want to know whether k6 open source can save test result in Prometheus?
1
vote
1 answer

Prometheus is not scraping stats d exporter

I am extremely new to docker,k6, Prometheus,statds. Scenario- Create a docker compost file which will run create K6 load test which has custom metrics. Send the result to Statsd Exporter (The idea is to use Prometheus as the database but since K6…
Jay
  • 339
  • 1
  • 7
  • 23
1
vote
1 answer

How to access browser session cookie for K6

I am writing some performance scripts using K6. I would like to create a user login from setup() method and use that cookie with request header of the next request within default() function. What's the easiest way to read browser cookies in K6? I…
Pubudu
  • 478
  • 1
  • 6
  • 22
1
vote
1 answer

Best way to install extensions with the k6 docker image?

I'm trying to install extensions with the k6 docker image via the go install command, but the pipeline is saying I don't have go. Does the base image not have golang available? I'm interested in using the Kafka k6 extension, but not sure the best…
Ryan
  • 1,102
  • 1
  • 15
  • 30