Skip to content
  • ZipCode Api
  • Blog
  • About RedLine13
RedLine13
RedLine13
Primary Navigation Menu
Menu
  • Start Testing
  • Demo
  • Pricing
  • JMeter
  • Partners
  • Docs
    • Documentation Home
    • AWS Set Up for load testing
    • AWS Approval for Large Tests
    • PHP, NodeJS, Python Load Tests
    • Scalability
    • Jenkins Plugin Setup
    • Premium Features
    • Knowledge Base

Tags and Thresholds in k6

By: David Koziel

Tags and Thresholds in k6

In this brief post, we will cover how to add individual requests to groups using the tags feature of k6. This feature can be used to label thresholds for reporting on grouped requests. By separating result metrics generated by your k6 test, it can become possible to isolate the performance of individual or related requests.

Suppose for a given test we have identified a performance issue; however the test is made up of several different requests. These separate requests each call essential endpoints for the process tested, and therefore would not be feasible to test them individually out of context. Nonetheless, we suspect that one of these requests is degrading the performance of the overall test.

Using the http_req_duration threshold, the example below illustrates how we can create two groups named “Product_Listing” and “Product_Details”. These groups are referenced in the requests that follow using tags:

Example k6 test plan script using tags to categorize requests into groups
Example k6 test plan script using tags to categorize requests into groups.

When we run our script, the test summary will now reflect separate metrics for http_req_duration for each of our defined tag groups:

k6 test summary detailing separation of line items by defined tag groups
k6 test summary detailing separation of line items by defined tag groups.

If you are running your test on RedLine13, you can download the test summary at the conclusion of the test as long as you have output files enabled. Analyzing this file, it is now possible to pinpoint performance discrepancies at the request level. In our hypothetical example, the “Product_Listing” endpoints are taking 5-10 times longer to complete than the “Product_Details” endpoints.


Did you know that RedLine13 offers a full-featured, time-limited free trial?  Sign up now, and start testing today!

2024-03-13
Previous Post: Importing User Modules in k6
Next Post: Setting k6 Environment Variables

Recent Posts

  • JMeter XML Format Post Processor
  • Order of Elements in JMeter
  • The JMeter Synthesis Report
  • Using the JMeter Plugins Manager
  • JMeter Rotating JTL Listener

Related

  • JMeter XML Format Post Processor
  • Order of Elements in JMeter
  • SAML Configuration with Azure AD and RedLine13
  • SAML Configuration with OKTA and RedLine13
  • SAML Configuration with Google and RedLine13
  • The JMeter Synthesis Report
  • Using the JMeter Plugins Manager
  • JMeter Rotating JTL Listener
  • Using Test Fragments in JMeter Tests
  • Step-by-Step Guide to Testing with JMeter

© RedLine13, LLC | Privacy Policy | Contract
Contact Us: info@redline13.com

Designed using Responsive Brix. Powered by WordPress.