Highlighted
Absent Member.
Absent Member.
261 views

Getting vuser count from controller

Hi all,

I am new to load runner scripting. I want to know how can i get the total count of vusers assigned in the controller to the script.

To be clear, in my script i specify to do some functionality based on the vuser. Let's say when it reaches 25 vusers do this functionality, when it reaches 75 stop the functionality.

To do this i need to get the total count of vusers assigned when the script is run from the controller.

I use C for scripting and the protocol i work on is web(http).

Kindly help.
0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

Re: Getting vuser count from controller

You can probably achieve your objective in either of the following ways:

1. Use the parameter of type VuserID. If the VuserID is between 25 and 75, only then perform your transaction.
Note that, this gives you the Vuser ID and not the Vuser count.
(I don't think you can get the count of the Vusers in a script)

OR

2. Use rendezvous point in your script. Use the function reference and Controller Guide for more info. I have pasted the following from the guide:

- Create the Vuser scripts, inserting lr_rendezvous function.
- Create a scenario.
When you add a Vuser group to a scenario, LoadRunner scans the groupâ s
associated script for the names of the rendezvous points and adds them to
the list in the Rendezvous Information dialog box (Scenario > Rendezvous).
If you create another Vuser group that runs the same script, the Controller
adds the new Vusers to the rendezvous and updates the list.
- Set the level of emulated user load.
You determine the exact level of load by selecting the rendezvous points
that will take part in the scenario, and how many Vusers will participate in
each rendezvous.
- Set the attributes for the rendezvous (optional).
For each rendezvous you can set Policy attributes. See the guide for further info
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Getting vuser count from controller

thanks archana for your comments.

As you already said getting the count of total vusers from the controller into the script is not possible.

Is there any work around for this.

As archana said based on the sample that i have provided, i can start a functionality when it reaches to 25 vusers which i can get using my vuserid function. But to stop the functionality, i need to stop it at the end .That is when my last vuser is doing the running. So for this i cannot precisely say what my last vuser id will be.


My aim is, by any means i need to find how many vusers are assigned to the controller through my script when we assign the script to a scenario and start running it.

As in controller the vuser_init,action and vuser_end run each time for every vuser i cannot set a global value also.


Also one more small query is, is there a way i can specify in my script that how vusers should be set when we open the script in the controller.

Kindly help.

Archana, thank you once again for your comments.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.