Get Max Number of User Concurrency in JMeter

In JMeter default lisnters some values are not provided by default and one of the examples is the max number of user concurrency which sometimes important if you’re executing a test which is not duration based.

In this article we’re going to execute a test with 200 users ramping 1 user each 2 sec and let’s see what is the max user concurrency we can get.

But first we need to install a plugin and add a listner as the following :

  1. install jmeter plugin manager from the link below
    https://jmeter-plugins.org/wiki/PluginsManager/
  2. After installation , open the plugin manager from jmeter and select the following plugin “3 Basic Graphs” from “Available Plugins” section
    Screen Shot 2018-07-14 at 11.52.10 AM
  3.  Make sure that you have a new listner under called “Active Threads Over Time” as the following picture
    Screen Shot 2018-07-14 at 12.02.43 PM

Now everything is in place lets make a quick run.

we’re going to use this fake API website “http://jsonplaceholder.typicode.com/” in our test

Screen Shot 2018-07-14 at 12.10.07 PM

Screen Shot 2018-07-14 at 12.10.34 PM

Screen Shot 2018-07-14 at 12.12.04 PM

Let’s execute and see the graph results 😉

Screen Shot 2018-07-14 at 12.19.43 PM

If we look at the graph above , we got a max of 1 concurrent user during the test run , so lets change the ramping up values and see the changes.

we will modify the thread group to be 200 threads / ramp-up Period : 50 as the following and execute again.

Screen Shot 2018-07-14 at 12.25.50 PM

Screen Shot 2018-07-14 at 12.27.09 PM

If we look at the graph above , in 2 times during the test we had more than 1 concurrent users. Because this is a simple http call with no business behind we got a smooth run and nearly constant results but in more real life test this graph will help you know the max number of concurrent users during your test.

 

 

Generate GUID in Apache JMeter

Although there is no dedicated sampler in JMeter to generate GUIDs but you can use the built-in functions to generate them.

In this article i will share with you how to generate GUID that is unique by user and iteration and use it through your JMeter thread group or test plan.

Steps:

  1. Open JMeter and add “Bean Shell Sampler”under your Thread Group

Screen Shot 2018-07-13 at 10.49.31 AM

2. Add a user defined variable that will hold the GUID value , set the varible name and leve the value empty

Screen Shot 2018-07-13 at 10.53.15 AM

3. Enter the following command in beanshell sampler
“vars.put(“VariableName”, “${__UUID}”);” where variable name is the name of variable created in the previous step.

Screen Shot 2018-07-13 at 11.01.10 AM

4. Now we need to verify that it is working so , we will add “Debug Samper” & “View Results Tree”

Screen Shot 2018-07-13 at 11.03.50 AM.png

Screen Shot 2018-07-13 at 11.05.45 AM

5. Save , Run and check the debug sampler values in the results tree

Screen Shot 2018-07-13 at 11.08.50 AM

6. now you can place the ${GUID} variable wherever you want in the thread group and it will generate a unique value for each user and each iteration (whenever the beanshell sampler executed).

*you can genrate more than one GUID everytime by pasting the line more than on time in the beanshell sampler and also add more variables in the user defined variables to hold the values.