USA: 1-623-232-1062 info@novaturetech.com

K6 – Performance Testing using K6

k61

Key features

 

k6 is an open-source load testing tool that makes performance testing easy and productive for quality engineering and devOps team. k6 is free, reliable and  developer-friendly.

K6 is best framework for early performance engineering and continuous Integration platform and its ideal tool for API/service level performance testing.

Using k6, you can test the reliability and performance of your systems and catch performance regressions and problems earlier in the application. k6 will help you to build resilient and performant applications that scale up to your production volume.

And also : The k6 Cloud is a commercial SaaS (software as a service) product that we’ve designed to be the perfect companion to k6 open source. It brings ease-of-use and convenience to your performance and load testing.

 

Key Points:

* CLI tool with developer-friendly APIs.

*Scripting in JavaScript ES2015/ES6 – with support for local and remote modules

Built-in modules

Local filesystem modules

Remote HTTP(S) modules

 

* Checks and Thresholds – for goal-oriented, automation-friendly load testing

 

* Checks :

 

Checks are true/false criteria for your test runtime values. If a check fails, k6 stores the result and the test continues to run. If you want to halt a run when a check fails, you can make a metric for the check and use it in a threshold.

In practice, checks often evaluate whether the system under test responds with a certain value. A check may evaluate:

 

* Thresholds:

 

Thresholds are pass/fail criteria for your test metrics. If a test metric does not meet the expectation you defined, the threshold fails. Often, k6 users use thresholds to codify their SLOs.

Thresholds can evaluate any metric that your test generates. For example, you could create a threshold for any combination of the following expectations:

Thresholds analyze the performance metrics and determine whether the final results passed or failed the test. Thresholds are essential for load-testing automation.

Use cases

k6 users are typically Developers, QA Engineers, SDETs, and SREs. They use k6 for testing the performance and reliability of APIs, microservices, and websites. Common k6 use cases are:

 

Load Testing Manifesto

 

Our load testing manifesto is the result of having spent years hip deep in the trenches, doing performance- and load testing. We’ve created it to be used as guidance, helping you in getting your performance testing on the right track!

 

What k6 does not

  1. Does not run natively in a browser – By default, k6 does not render web pages the same way a browser does. Browsers can consume significant system resourceJ

2 Does not run in NodeJS- avaScript is not generally well suited for high performance. To achieve maximum performance, the tool itself is written in Go, embedding a JavaScript runtime allowing for easy test scripting

 

K6 – Grafana Integration:

k67

Using Grafana you can send your k6 test metrics into Grafana dashboard for better visualisation and store your testing results.

k62

k63

K6 CICD Process:

 

A CI/CD pipeline is the full set of deployment processes that enable the job when its triggered. Also the pipleline contains deployment/unit testing/Functional automation testing and performance testing, K6 very well support with circleCI to enable the performance testing test job and the deployment can be controlled based on the K6 performance test results and its thresholds.

Ex :       performance-tests:

<<: *defaults

machine:

image: <Cluster name >

resource_class: medium

steps:

– checkout

– *k6_performance_tests

 

 


Author: Ganeshan Nainapillai   | Posted On: 14th October 2022   | Category: Article

© 2024 Novature Tech Pvt Ltd. All Rights Reserved.