6

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 debugger.

I tried to run the script on its own by attaching the node inspect debugger (https://nodejs.org/api/debugger.html) but the file doesn't get executed because the import and export module keywords are unrecognized by this current version of node (8.7.0)

I'm also unable to find any documentation on how to debug these scripts.

ppcano
  • 2,831
  • 1
  • 24
  • 19
Jason Lee
  • 93
  • 5

2 Answers2

2

There is no debugger support (currently known) for k6 scripting. It's manual debugging at this time.

k6 runs javascript (ECMA6) and has an API documented at http://k6.io

Sidenote: k6 is not node and will not work with node tooling.

0

I recently opened an issue about this - the need for a "debug" mode where detailed information about requests is printed to stdout.

https://github.com/loadimpact/k6/issues/331

To be clear, this issue is not about creating a "real" debugger, like gdb or similar, where you can step through script code, but rather a special mode of operation where lots of HTTP request information is being output to stdout in real time, to facilitate understanding exactly what is happening between client and server when your script code is executed.

I will probably try to implement something like this as soon as Emily (the maintainer) merges in some major CLI changes she is working on right now.

Ragnar
  • 1,122
  • 1
  • 9
  • 16