Member-only story

K6 Performance Testing with Inbuilt Reporting and Dashboards

Shivam Bharadwaj
JavaScript in Plain English
4 min readOct 5, 2024

Why K6’s Dashboard is a Must-Have for Performance Testing?

Image by Author

New to k6? Let’s set it up first 🛋️

Installation

  • MacOS — brew install k6
  • Windows (choco) — choco install k6
  • Docker — docker pull grafana/k6

For latest & additional installation info, refer to k6 official doc

If you are behind the Medium paywall and can’t read this article, click here this publication is open to everyone.

Writing your first k6 load test (-_-)

Time to write the code!

k6 supports multiple protocols, but for now, let’s stick to HTTP. Your first script will do a basic HTTP POST request against a test API that will echo back whatever you send to it.

Any code in the default function is executed by each k6 virtual user when the test runs.

You could actually run this script already, and k6 would make the HTTP POST request, but how would you know if it worked? Here’s the check function which will assert the response

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Published in JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.

Written by Shivam Bharadwaj

Senior SDET | Passionate For Software Quality | Automation | Love sharing insights | https://www.linkedin.com/in/meetshivambharadwaj

Responses (2)

Write a response

k6 helps engineering teams prevent errors and SLO breaches, enabling them to build resilient and high-performing applications that scale.

Good article. Have you tried using multiple API endpoints? Looks like K6 generates one aggregated report for all the endpoints.