LR Script custom Display controller virtual user state

Source: Internet
Author: User

In the process of scene monitoring, you want to know the running state of vusers when the scene is running and how many times each VUser virtual user is running in this scene, then you need to customize the display of Virtual user state information in the Vugen script.

The code is as follows:

Static intiteration; Action_userstatus () {//display parameter value in Vugen script, parameter alias is paramLr_output_message ("Current parameter:%s", Lr_eval_string ("{parameter}")); //A certain amount of thought time is set up, which correspondingly reduces the pressure on the load generator and slows down the system resources to avoid affecting the test results .Lr_think_time (4); //Displays the current parameter value and the number of current iterations in the Controller monitoring windowLr_vuser_status_message ("Current parameter:%s, iteration count:%d", Lr_eval_string ("{parameter}"),++iteration); return 0;}

After running the scene (Run interface), click VUser to open the view of the virtual user runtime, you can see each virtual user in the scene of the number of iterations, you can also calculate how many times the scene has been iterated (that is, how many times to run the script code in the action),

Observe how many iterations each virtual user tried, how many iterations were successful,

Through the above operation monitoring, we can draw a conclusion:

The "Run-time Settings" set in the controller scene overrides the "Run-time Settings" setting in the Vugen script, setting the number of iterations of the runtime in the controller scene, which is the "duration" set in the scene plan. "The number of iterations of a long-duration scene will be the same (PS: the corresponding TPS, throughput will increase).

LR Script custom Display controller virtual user state

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.