Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      10 Ways Node.js Development Boosts AI & Real-Time Data (2025-2026 Edition)

      August 18, 2025

      Looking to Outsource React.js Development? Here’s What Top Agencies Are Doing Right

      August 18, 2025

      Beyond The Hype: What AI Can Really Do For Product Design

      August 18, 2025

      BrowserStack launches Chrome extension that bundles 10+ manual web testing tools

      August 18, 2025

      How much RAM does your Linux PC really need in 2025?

      August 19, 2025

      Have solar at home? Supercharge that investment with this other crucial component

      August 19, 2025

      I replaced my MacBook charger with this compact wall unit – and wish I’d done it sooner

      August 19, 2025

      5 reasons to switch to an immutable Linux distro today – and which to try first

      August 19, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Sentry Adds Logs Support for Laravel Apps

      August 19, 2025
      Recent

      Sentry Adds Logs Support for Laravel Apps

      August 19, 2025

      Efficient Context Management with Laravel’s Remember Functions

      August 19, 2025

      Laravel Devtoolbox: Your Swiss Army Knife Artisan CLI

      August 19, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      From plateau predictions to buggy rollouts — Bill Gates’ GPT-5 skepticism looks strangely accurate

      August 18, 2025
      Recent

      From plateau predictions to buggy rollouts — Bill Gates’ GPT-5 skepticism looks strangely accurate

      August 18, 2025

      We gave OpenAI’s open-source AI a kid’s test — here’s what happened

      August 18, 2025

      With GTA 6, next-gen exclusives, and a console comeback on the horizon, Xbox risks sitting on the sidelines — here’s why

      August 18, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»How to configure JMeter to dynamically read data from one of multiple CSV files based on load distribution?

    How to configure JMeter to dynamically read data from one of multiple CSV files based on load distribution?

    April 21, 2025

    I’m working on performance testing a multi-tenant application using Apache JMeter. I want to simulate load coming from three different clients, where each client’s data is stored in a separate CSV file. The load should be distributed like this:

    • Client 1: 60%
    • Client 2: 30%
    • Client 3: 10%

    All CSV files have the same structure (columns), but contain different data per client.

    My Goal:
    I want each thread to randomly and proportionally pick data from the appropriate CSV file based on the percentages above and use it in the HTTP requests without data overlap or inconsistency.

    What I Tried:

    Approach 1: Dynamically set file path using a variable
    My Jmeter Test Plan structure is,

    Test Plan
    |-- User Defined Variables
    |-- CSV Data Set Config
    |-- Stepping Thread Group
    |-- |-- JSR223 PreProcessor
    |-- |-- HTTP Request Sampler 1
    |-- |-- HTTP Request Sampler 2
    |-- |-- HTTP Request Sampler n
    |-- View Result Tree
    |-- Summary Report
    

    In the Test Plan, I have a variable path defined in User Defined Variables as:

    path = D:/jmeter/project
    

    I then set the Filename in CSV Data Set Config to ${csvFile}.

    Inside a JSR223 PreProcessor, I tried setting the csvFile variable like this:

    def randomValue = Math.random()
    if (randomValue < 0.6) {
        vars.put('csvFile', "${path}/file1.csv")
    } else if (randomValue < 0.9) {
        vars.put('csvFile', "${path}/file2.csv")
    } else {
        vars.put('csvFile', "${path}/file3.csv")
    }
    

    The issue is, even though csvFile gets set correctly in the JSR223 PreProcessor, the CSV Data Set Config doesn’t pick up the value dynamically.

    Approach 2: Dynamically set file path using a variable and place the CSV Data Set Config after the JSR223 PreProcessor

    My Jmeter Test Plan structure is,

    Test Plan
    |-- User Defined Variables
    |-- Stepping Thread Group
    |-- |-- JSR223 PreProcessor
    |-- |-- CSV Data Set Config
    |-- |-- HTTP Request Sampler 1
    |-- |-- HTTP Request Sampler 2
    |-- |-- HTTP Request Sampler n
    |-- View Result Tree
    |-- Summary Report
    

    Still the result is the same as in Approach 1.

    I suspect it’s due to the execution order, as JMeter processes the CSV Data Set Config before the PreProcessor runs.

    My Question:

    What is the correct way in JMeter to:

    • Dynamically and proportionally distribute threads across multiple CSV files
    • Ensure clean separation of data per thread (no variable conflicts)
    • Avoid data overlap or race conditions between threads

    Note: I cannot share actual screenshots or project files due to employer restrictions, but I’m looking for a JMeter-safe and scalable way to simulate this kind of weighted load across clients using separate CSV files or anything other suggestion for tackling this issue.

    Any ideas or recommendations for managing this effectively?

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleThe Ultimate Guide to Demo Websites for Selenium Automation Testing
    Next Article ByteDance Releases UI-TARS-1.5: An Open-Source Multimodal AI Agent Built upon a Powerful Vision-Language Model

    Related Posts

    Development

    Sentry Adds Logs Support for Laravel Apps

    August 19, 2025
    Development

    Efficient Context Management with Laravel’s Remember Functions

    August 19, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    fum is a TUI-based MPRIS music client

    Linux

    Free Online Trauma Test for Kids and Adults | TraumaTest.org

    Web Development

    CVE-2025-32799 – Conda-build Tar Slip Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    This Free ChatGPT Alternative has Unlimited Usage in 2025 with Voice Mode and it’s called Pi

    Artificial Intelligence

    Highlights

    Today’s LLMs craft exploits from patches at lightning speed

    April 21, 2025

    Today’s LLMs craft exploits from patches at lightning speed

    The time from vulnerability disclosure to proof-of-concept (PoC) exploit code can now be as short as a few hours, thanks to generative AI models.
    Matthew Keely, of Platform Security and penetration te …
    Read more

    Published Date:
    Apr 21, 2025 (1 hour, 24 minutes ago)

    Vulnerabilities has been mentioned in this article.

    CVE-2025-32433

    CVE-2025-3861 – WordPress Prevent Direct Access Unauthorized Access Vulnerability

    April 25, 2025

    Closing your Apple Watch rings can lower less stress, improve sleep – and win you prizes

    April 14, 2025

    UK Military Unveils £1B ‘Digital Targeting Web’

    May 29, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.