Search code examples
csvjmeterload-testingjmeter-plugins

Jmeter - How do I output a counter variable to my csv results file?


What I want to accomplish is to have a thread group with multiple GETS, each GET is tagged with the same thread ID, until another thread is started. The problem I have is when I hold a constant load, those thread IDs are recycled. So I thought I'll add a counter, and this way the thread unique ids will not be duplicated. Yet I have google'd and read all over the internet and tried and tried but I cannot seem to get the Counter Config to output to a variable and then have that changing variable written to my csv file.


Solution

  • If you are open to trying other test platforms, you may want to take a look at NetGend. It's easy to have many concurrent sessions and each will use a different Id. See the following example.

    function userInit() {
        var globalId = 1;
    }
    function VUSER() {
        id = globalId ++;
        action(http, "http://www.example.com/?${id}");
    }
    

    There are lots of blogs showing how easy it is to script on NetGend platform.