{"id":11186,"date":"2024-09-11T22:19:36","date_gmt":"2024-09-12T02:19:36","guid":{"rendered":"https:\/\/www.redline13.com\/blog\/?p=11186"},"modified":"2024-09-11T22:19:37","modified_gmt":"2024-09-12T02:19:37","slug":"jmeter-weighted-switch-controller","status":"publish","type":"post","link":"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/","title":{"rendered":"Using the JMeter Weighted Switch Controller"},"content":{"rendered":"<p><a id=\"post-11186-_xff4fhlhad3g\"><\/a> <img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-11187\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/09\/word-image-11186-1.png\" alt=\"Using the JMeter Weighted Switch Controller\" width=\"400\" height=\"300\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/09\/word-image-11186-1.png 400w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/09\/word-image-11186-1-300x225.png 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/p>\n<p>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 <a href=\"https:\/\/github.com\/Blazemeter\/jmeter-bzm-plugins\/blob\/master\/wsc\/WeightedSwitchController.md\" target=\"_blank\" rel=\"noopener\">Weighted Switch Controller<\/a> 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 <em>Weighted Switch Controller<\/em>.<\/p>\n<h3><a id=\"post-11186-_7fznn92bo3n2\"><\/a>Installing the JMeter Weighted Switch Controller<\/h3>\n<p>You can use the <a href=\"https:\/\/jmeter-plugins.org\/wiki\/PluginsManager\/\" target=\"_blank\" rel=\"noopener\"><em>JMeter Plugin Manager<\/em><\/a> to search for publicly available components hosted on jmeter-plugins.org. From the <em>Options<\/em> menu select \u201c<em>JMeter Plugin Manager<\/em>\u201d:<\/p>\n<figure id=\"attachment_11188\" class=\"wp-caption aligncenter\" style=\"max-width: 755px\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-11188\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/09\/word-image-11186-2.png\" alt=\"Installing the Weighted Switch Controller from the JMeter Plugins Manager\" width=\"755\" height=\"389\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/09\/word-image-11186-2.png 1006w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/09\/word-image-11186-2-300x154.png 300w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/09\/word-image-11186-2-768x395.png 768w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/09\/word-image-11186-2-425x219.png 425w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\" \/><figcaption class=\"wp-caption-text\">Installing the Weighted Switch Controller from the JMeter Plugins Manager.<\/figcaption><\/figure>\n<p>Click on the \u201c<em>Available<\/em>\u201d tab and type \u201c<em>weighted<\/em>\u201d to locate the plugin. From there you can select the plugin on the left and click \u201c<em>Apply Changes and Restart JMeter<\/em>\u201d, as installing will require a restart of the GUI.<\/p>\n<h3><a id=\"post-11186-_vkwhq87tmhyk\"><\/a>Configuring the JMeter Weighted Switch Controller<\/h3>\n<p>For a test with multiple samplers, you can add these under the <em>Weighted Switch Controller<\/em>, which is typically added inside a <a href=\"https:\/\/www.redline13.com\/blog\/2022\/10\/jmeter-custom-thread-groups\/\" target=\"_blank\" rel=\"noopener\">thread group<\/a>. In the example below, we have two <a href=\"https:\/\/jmeter.apache.org\/usermanual\/component_reference.html#HTTP_Request\" target=\"_blank\" rel=\"noopener\">HTTP Request samplers<\/a>. The configuration is such that \u201c<em>Request A<\/em>\u201d will receive 75% of requests, while the remaining 25% of requests will be routed via \u201c<em>Request B<\/em>\u201d:<\/p>\n<figure id=\"attachment_11189\" class=\"wp-caption aligncenter\" style=\"max-width: 748px\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-11189\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/09\/word-image-11186-3.png\" alt=\"Configuring the JMeter Weighted Switch Controller\" width=\"748\" height=\"301\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/09\/word-image-11186-3.png 798w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/09\/word-image-11186-3-300x121.png 300w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/09\/word-image-11186-3-768x309.png 768w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/09\/word-image-11186-3-425x171.png 425w\" sizes=\"auto, (max-width: 748px) 100vw, 748px\" \/><figcaption class=\"wp-caption-text\">Configuring the JMeter Weighted Switch Controller.<\/figcaption><\/figure>\n<p>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 \u201c<em>Request A<\/em>\u201d with a weight of 3 and \u201c<em>Request B<\/em>\u201d 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.<\/p>\n<hr \/>\n<p>Did you know that RedLine13 offers a full-featured, time-limited free trial? \u00a0<a href=\"https:\/\/www.redline13.com\/Service\" target=\"_blank\" rel=\"noopener\">Sign up now<\/a>, and start testing today!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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<a class=\"more-link\" href=\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/\">Read More &rarr;<\/a><\/p>\n","protected":false},"author":11,"featured_media":11187,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[283,299,318,424,726,724,725],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-dkoziel","4":"post-11186","6":"format-standard","7":"has-post-thumbnail","8":"category-blog","9":"post_tag-jmeter","10":"post_tag-jmeter-plugins","11":"post_tag-load-testing","12":"post_tag-redline13","13":"post_tag-request-routing","14":"post_tag-weighted-switch","15":"post_tag-weighted-switch-controlller"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.12 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Using the JMeter Weighted Switch Controller - RedLine13<\/title>\n<meta name=\"description\" content=\"In this article, we will show you how to set up the JMeter Weighted Switch Controller to route your requests asymmetrically.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using the JMeter Weighted Switch Controller - RedLine13\" \/>\n<meta property=\"og:description\" content=\"In this article, we will show you how to set up the JMeter Weighted Switch Controller to route your requests asymmetrically.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/\" \/>\n<meta property=\"og:site_name\" content=\"RedLine13\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-12T02:19:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-12T02:19:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/09\/word-image-11186-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"David Koziel\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"David Koziel\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/\"},\"author\":{\"name\":\"David Koziel\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20\"},\"headline\":\"Using the JMeter Weighted Switch Controller\",\"datePublished\":\"2024-09-12T02:19:36+00:00\",\"dateModified\":\"2024-09-12T02:19:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/\"},\"wordCount\":324,\"publisher\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\"},\"keywords\":[\"JMeter\",\"jmeter-plugins\",\"Load Testing\",\"RedLine13\",\"Request Routing\",\"Weighted Switch\",\"Weighted Switch Controlller\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/\",\"url\":\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/\",\"name\":\"Using the JMeter Weighted Switch Controller - RedLine13\",\"isPartOf\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#website\"},\"datePublished\":\"2024-09-12T02:19:36+00:00\",\"dateModified\":\"2024-09-12T02:19:37+00:00\",\"description\":\"In this article, we will show you how to set up the JMeter Weighted Switch Controller to route your requests asymmetrically.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.redline13.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using the JMeter Weighted Switch Controller\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#website\",\"url\":\"https:\/\/www.redline13.com\/blog\/\",\"name\":\"RedLine13\",\"description\":\"(Almost) Free Load Testing in the Cloud\",\"publisher\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.redline13.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\",\"name\":\"RedLine13\",\"url\":\"https:\/\/www.redline13.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg\",\"contentUrl\":\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg\",\"width\":300,\"height\":68,\"caption\":\"RedLine13\"},\"image\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20\",\"name\":\"David Koziel\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g\",\"caption\":\"David Koziel\"},\"url\":\"https:\/\/www.redline13.com\/blog\/author\/dkoziel\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using the JMeter Weighted Switch Controller - RedLine13","description":"In this article, we will show you how to set up the JMeter Weighted Switch Controller to route your requests asymmetrically.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/","og_locale":"en_US","og_type":"article","og_title":"Using the JMeter Weighted Switch Controller - RedLine13","og_description":"In this article, we will show you how to set up the JMeter Weighted Switch Controller to route your requests asymmetrically.","og_url":"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/","og_site_name":"RedLine13","article_published_time":"2024-09-12T02:19:36+00:00","article_modified_time":"2024-09-12T02:19:37+00:00","og_image":[{"width":400,"height":300,"url":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2024\/09\/word-image-11186-1.png","type":"image\/png"}],"author":"David Koziel","twitter_card":"summary_large_image","twitter_misc":{"Written by":"David Koziel","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/#article","isPartOf":{"@id":"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/"},"author":{"name":"David Koziel","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20"},"headline":"Using the JMeter Weighted Switch Controller","datePublished":"2024-09-12T02:19:36+00:00","dateModified":"2024-09-12T02:19:37+00:00","mainEntityOfPage":{"@id":"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/"},"wordCount":324,"publisher":{"@id":"https:\/\/www.redline13.com\/blog\/#organization"},"keywords":["JMeter","jmeter-plugins","Load Testing","RedLine13","Request Routing","Weighted Switch","Weighted Switch Controlller"],"articleSection":["Blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/","url":"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/","name":"Using the JMeter Weighted Switch Controller - RedLine13","isPartOf":{"@id":"https:\/\/www.redline13.com\/blog\/#website"},"datePublished":"2024-09-12T02:19:36+00:00","dateModified":"2024-09-12T02:19:37+00:00","description":"In this article, we will show you how to set up the JMeter Weighted Switch Controller to route your requests asymmetrically.","breadcrumb":{"@id":"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.redline13.com\/blog\/2024\/09\/jmeter-weighted-switch-controller\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.redline13.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Using the JMeter Weighted Switch Controller"}]},{"@type":"WebSite","@id":"https:\/\/www.redline13.com\/blog\/#website","url":"https:\/\/www.redline13.com\/blog\/","name":"RedLine13","description":"(Almost) Free Load Testing in the Cloud","publisher":{"@id":"https:\/\/www.redline13.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.redline13.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.redline13.com\/blog\/#organization","name":"RedLine13","url":"https:\/\/www.redline13.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg","contentUrl":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg","width":300,"height":68,"caption":"RedLine13"},"image":{"@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/51d282221e3230ab35f964f98ada9b20","name":"David Koziel","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2babf644e0993fc86893c24d7525f1e3be114a8746c01249797f25587ae1697a?s=96&d=mm&r=g","caption":"David Koziel"},"url":"https:\/\/www.redline13.com\/blog\/author\/dkoziel\/"}]}},"_links":{"self":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/11186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/comments?post=11186"}],"version-history":[{"count":1,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/11186\/revisions"}],"predecessor-version":[{"id":11190,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/11186\/revisions\/11190"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/media\/11187"}],"wp:attachment":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/media?parent=11186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/categories?post=11186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/tags?post=11186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}