Local and On-premise execution

Running load tests from your laptop or an on-premise machine is one of the ways you can use k6.

Executing a local test

To execute a test where the traffic is generated from the local machine you execute the run k6 command. So say you have a test in a file called script.js, you’d then trigger a local test by executing the following in your terminal:

k6 run script.js

Streaming results to Insights

By default when running a local test, k6 will output a summary of the results to the terminal. The results are not persisted by default. If you want to store the results, graphically analyze them, share them with your team mates and trend the performance of your system over time, you can opt to send your test results to LoadImpact Insights.

You do this by first making sure you’re logged in to your LoadImpact account:

k6 login cloud (for more authentication options, see here)

and then adding the -o cloud CLI flag:

k6 run -o cloud script.js

You should now see something like this in your terminal: Local execution with Insights streaming Note the URL in the output: cloud ( That URLs is where you go to see the test results as they come streaming in from the test execution.

See also: Cloud execution