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

Accessing a service on the PROPER IP running in docker container on a Linux host

My problem is specific to k6 and InfluxDB, but i think the root cause is more general. I'm using the official k6 distribution and its docker-compose.yml to run Grafana and InfluxDB which i start with the docker-compose up -d influxdb grafana…
inspiral
  • 611
  • 1
  • 7
  • 15
0
votes
1 answer

K6 Get request result in error against specific endpoint URL

I am new to K6 and am trying to use the tool to perform a Get request by verifying an API. When the script is executed I get a warning that terminates the scrip. As far as my understanding is that this error is somewhat related to Go (if I have…
0
votes
1 answer

Installing local version of postman-to-k6 results in npm errors

My situation is, I am trying to install postman-to-k6 to get insight how to work with conversions from postman to K6. My attempts install the software on both my Ubuntu machine and my mac, have been unsuccessfully. So my question is am I missing…
0
votes
1 answer

k6 environmental variables results in GO error "invalid character"

k6 docs make using environmental variables very simple and I tried following their instructions, but I get a GO error when I try to run it: ERRO[0000] GoError: parse https://${__ENV.TARGET_ENV}-api.mycompany.com/v1/managers/259999/properties":…
Pix81
  • 585
  • 3
  • 15
  • 33
0
votes
1 answer

Bombarded AWS EC2 with K6 - 3000 VU. Connections started timing out and now I can't connect to the instance over SSL or HTTP requests. What is this?

As the title says, did a test 5000 VU max. As I approached 3000 VU, started getting back connection timed out errors. No HTTP requests went through after that. It's been locked up ever since. I've tried rebooting. Done it several times to no…
0
votes
1 answer

'k6 cloud' doesn't work in jenkins but 'k6 run works'

I am trying to do load testing in jenkins pipeline using k6 open-source platform. The below given code is my Jenkinsfile to run load testing. when I try 'k6 run loadtests/performance-test.js', I get the perfect output in the jenkins console. But 'k6…
0
votes
1 answer

How to make a simple POST request in k6 with multiple custom headers

I cannot get this script working for the life of me as I get error: INFO[0001] {"error":{"code":2,"message":"Invalid or Missing X-App-Token","documentation":""}} However, a curl request with this header works fine. This is a custom header we use in…
Pix81
  • 585
  • 3
  • 15
  • 33
0
votes
1 answer

k6 https://k6.io/ tool reports negative http_req_duration time

I am trying to run very simple scenario with k6 tool. Sometimes it reports negative number for http_req_duration time which is confusing me. QUESTION: How is that possible or how to interpret negative number in this context? The description of…
ludenus
  • 1,161
  • 17
  • 30
0
votes
1 answer

How to create a dropdown variable with tag values in a Grafana dashboard?

I am using Grafana and InfluxDB with K6. My tests are generating data for some metrics and I am always defining a test-wide tag testrunname which is set to a different value every time. In Grafana, I want to add a variable in my dashboard, and I…
Andry
  • 16,172
  • 27
  • 138
  • 246
0
votes
1 answer

x509: certificate signed by unknown authority CMD K6.io

I am presently using a nice tool to perform performance testing (load) for a project via a VPN. I am using K6.io and SOAPUI. run the same tool using both tools just to compare results. K6.io is a Javascript library that gathers robust configurable…
ken4ward
  • 2,246
  • 5
  • 49
  • 89
0
votes
0 answers

Getting error TypeError: Object has no member 'forEach' in javascript while returning array from setup method in k6

When I am trying to return an array from setup method and try to use it in VU method, I am getting the below error TypeError: Object has no member 'forEach' in javascript Please find below my code; export function getResponseMapStub() { var…
Sourabh Roy
  • 159
  • 1
  • 18
0
votes
1 answer

How to use xmlhttprequest or xhr2 with k6

I want to use the libraries xmlhttprequest or xhr2 with K6 performance testing tool. As k6 does not support the node module, I am getting the below error GoError: Module specifier "xhr2" was tried to be loaded as remote module by prepending…
Sourabh Roy
  • 159
  • 1
  • 18
0
votes
1 answer

Static variable for VUs in K6

Is there a way to use a static variable shared across VUs in K6. Say // init code let x = 0 // i want this to be static // options export let options = { vus : 10, iterations : 10 }; // VU code export default function() { x++; …
Sid
  • 45
  • 2
  • 9
0
votes
1 answer

How do I generate a summary report for each scenario at once on K6 tool?

I could run some performance tests successfully with K6. However, I've been trying to generate a single summary report for each of the 4 scenarios at once, but I couldn't. The workaround is to keep a single scenario (comment the others or remove…
0
votes
1 answer

K6 Load Testing - How to calculate accurate response times when using the rps option

I am recording how long each request takes by capturing Date.now() before and after the request. I am doing this because the inbuild metric for the response time only records the time taken for the FIRST REQUEST and not for any redirects that it…
Matt
  • 773
  • 2
  • 15
  • 30