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

Using the JMeter Weighted Switch Controller

By: David Koziel

Using the JMeter Weighted Switch Controller

When designing tests that mirror real-world behaviors, we may find the need to route more requests to one target test endpoint over another. The JMeter Weighted Switch Controller provides a method of asymmetrically routing requests to two or more target test endpoints. You can assign higher weights to samplers being run and proportionally more frequently than samplers with lower assigned weights. In this brief article, we will show you how to set up the Weighted Switch Controller.

Installing the JMeter Weighted Switch Controller

You can use the JMeter Plugin Manager to search for publicly available components hosted on jmeter-plugins.org. From the Options menu select “JMeter Plugin Manager”:

Installing the Weighted Switch Controller from the JMeter Plugins Manager
Installing the Weighted Switch Controller from the JMeter Plugins Manager.

Click on the “Available” tab and type “weighted” to locate the plugin. From there you can select the plugin on the left and click “Apply Changes and Restart JMeter”, as installing will require a restart of the GUI.

Configuring the JMeter Weighted Switch Controller

For a test with multiple samplers, you can add these under the Weighted Switch Controller, which is typically added inside a thread group. In the example below, we have two HTTP Request samplers. The configuration is such that “Request A” will receive 75% of requests, while the remaining 25% of requests will be routed via “Request B”:

Configuring the JMeter Weighted Switch Controller
Configuring the JMeter Weighted Switch Controller.

It should be noted that weights are expressed in terms of proportions, and do not necessarily need to add up to 100. We would get the same result if we configured “Request A” with a weight of 3 and “Request B” with a weight of 1, thereby attaining 3:4 and 1:4 proportions which are equivalent. Expressing in terms of 100 however may be convenient as we have done above.


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

2024-09-11
Previous Post: JMeter Best Practices
Next Post: QualiTlabs Case Study: Cost-Effective Performance Testing for a Healthcare Mobile App

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
  • 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
  • Functional Testing vs Performance Testing
  • A Gentle Introduction to Load Testing
  • Using the JMeter Counter Element

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

Designed using Responsive Brix. Powered by WordPress.