Open source

Get started with k6

This tutorial provides some procedures for common real-life uses of k6. They assume no prior knowledge of k6 or of JavaScript.

These tasks are all reproducible, so open up your favorite editor and follow along. Imagine that you are a developer or tester who is responsible for performance in your development team.

Context: test a new endpoint

Your development team has just developed a new login endpoint. Before releasing, you must test the endpoint for the following questions:

  • Does it work?
  • Does it perform within the service-level objectives under average load?
  • At what load does performance degrade beyond objectives?

After you test the endpoint, your team wants you to compare different components of the user-facing application.

Finally, after you test the API and web application, break your scripts down into reusable parts.

Before you start

We encourage you to open your terminal and actively experiment with these examples. The tutorial requires the following:

  • k6 installed
  • A clean directory to experiment in.
  • Something to do during the minute or two when k6 runs the longest example tests
  • Optional: jq to filter some results


In this tutorialLearn how to
Test for functional behaviorUse k6 to script requests and evaluate that performance is correct
Test for performanceUse k6 to increase load and find faults
Analyze resultsFilter results and make custom metrics
Reuse and re-runModularize and re-run tests