Load Impact offers a SaaS solution for k6 results storage and analysis. It is called Load Impact Insights. Insights allows you to run your load tests locally using k6 while streaming your results to loadimpact.com where you can look at the test in real time and also perform detailed results analysis.
Load Impact Insights screenshot
This means you can run your own load generator and test internal systems, but benefit from a more powerful and convenient SaaS solution when you want to store, share and analyze test results. In the near future, k6 will also be able to utilize the loadimpact.com cloud to execute tests (but such tests will of course require that the target system is reachable from the public Internet).
First you need to create a loadimpact.com account
Next, open up your account page on loadimpact.com and click the "join our insider program" to enable early access to Load Impact Insights
Set your local environment variable
K6_CLOUD_TOKENto contain your loadimpact.com API key and run k6 using the
K6CLOUD_TOKEN is now K6_CLOUD_TOKEN
Starting with v0.18.0
K6CLOUD_TOKEN has been renamed
K6_CLOUD_TOKEN. The old spelling will still work in v0.18.0 but a deprecation message will be printed to the terminal.
K6_CLOUD_TOKEN=c3b391149764640ed7d51476cd34a947f0d0762552a5bae79ee10b07ee84c1f7 k6 run -o cloud script.js
docker run -i -e "K6CLOUD_TOKEN=c3b391149764640ed7d51476cd34a947f0d0762552a5bae79ee10b07ee84c1f7" loadimpact/k6 run -o cloud - <script.js
Now your test should be running, and results should be streamed live to loadimpact.com. k6 will output something like this when it starts:
As you can see in the screen shot above, k6 will tell you that you can use the URL
https://app.loadimpact.com/k6/runs/179 to go directly to the test result/analysis page where results will be updated continuously throughout the test.
When you run a k6 test run against Load Impact Insights, data will be continuously streamed into the cloud. While this happens the test's run state will be marked as
Running. A test run that ran its course will be marked
Finished. The run state has nothing to do with the test passing any of its checks, only that the test itself is operating correctly.
If you deliberately abort your test (e.g. by pressing Ctrl-C), it will still be considered
Finished by Insights. You can still look and analyze the test data you streamed so far. The test will just have run shorter than originally planned.
Another possibility would be if you lose network connection with Load Impact Insights while your test is running. In that case Insights will patiently wait for you to reconnect. In the meanwhile your test's run state will continue to appear as
Running on the Insights web overview. If no reconnection happens, Insights will time out after two minutes of no data, setting the run state to
Timed out. You can still analyze a timed out test but you'll of course only have access to as much data as was streamed before the network issue.