Re: TruClient - Multiply wait time (753 Views)
Reply
Collector
Jernstorm
Posts: 1
Registered: ‎10-22-2013
Message 1 of 8 (798 Views)

TruClient - Multiply wait time

Hi,

 

We have recently started using truClient, but we have problems when it comes to multiplying wait time (Like the functionality for multiplying think time in http web scripts). The only value we can find is "wait time", but there is no "multiply wait time" setting in runtime settings in Performance Center.

 

We thought about having an external param file and using a value there as base for multiplying think time, but I'm not sure this is very ideal. Is there a "best practice" way to multiply wait-time in truClient scripts ?

Regular Advisor
Arjun_Valipired
Posts: 71
Registered: ‎08-05-2011
Message 2 of 8 (773 Views)

Re: TruClient - Multiply wait time

[ Edited ]

I found this useful link from http://www.perftesting.co.uk, hope it helps.

 

End-user behavior is unpredictable and as a performance test engineer, while executing a performance test, our aspiration should always be to reach closest to the real time scenario. Some end users may spend only 2 secs before navigating to next page, while many others may think for more time. Hence in many test scenarios, it would not be ideal to insert a fixed think time value before a web request; rather one must use random think time in such cases. This can be done using advanced javascript functionalities and these are the steps -

 

1) From ‘Toolbox’, copy a wait function and paste it before the web request. 2) In the argument section, replace the interval value ’3′ by ‘Math.floor(11*Math.random()+5);

The above function will return a random number between 5 and 15.

Math.floor() method rounds a number DOWNWARDS to its nearest integer. (Eg. The output of code ’Math.floor(1.8);‘ is 1). Hence 11 is used as a multiplication factor so that an integer in the upper decimals of 10 will be rounded to 10. Math.random() method returns a random number between 0 and 1.

 

Good luck

 

 

HP Expert
Guy_Rosenthal
Posts: 248
Registered: ‎10-24-2011
Message 3 of 8 (753 Views)

Re: TruClient - Multiply wait time

Why not using Minimum Time feature (described in the User Guide)?

Guy Rosenthal
TruClient RnD Team Manager
TruClient-StormRunner Load RnD
Frequent Advisor
PeetD
Posts: 59
Registered: ‎08-28-2013
Message 4 of 8 (611 Views)

Re: TruClient - Multiply wait time

This indicates that I can use the minimum time in the runtime settings to configure a think time.

Is this correct?

 

I surely would like to be able to use this as adding an additional wait step is a pain when scripts become long, it also degrades the readability of the script.

 

It's a pity that the steps minimum time does not support parameterization. I would like to either use a parameter or a javascript variable for this. That does not work in VUgen 11.52 using firefox TruClient.

Will this be possible in future releases?

 

Thank,

Peet

HP Expert
Guy_Rosenthal
Posts: 248
Registered: ‎10-24-2011
Message 5 of 8 (600 Views)

Re: TruClient - Multiply wait time

Hi Peet,

Thanks for yourfeedback, we'll consider adding this ability in our future releases.

Guy Rosenthal
TruClient RnD Team Manager
TruClient-StormRunner Load RnD
Regular Advisor
Speedmaster
Posts: 159
Registered: ‎11-12-2009
Message 6 of 8 (592 Views)

Re: TruClient - Multiply wait time

Maybe try something like this?

 

// wait 1-3s
//Math.round( Math.random() * (max - min) + min )
Math.round( Math.random() * (3 - 1) + 1 )

// wait 5-10s
//Math.round( Math.random() * (max - min) + min )
Math.round( Math.random() * (10 - 5) + 5 )

Frequent Advisor
PeetD
Posts: 59
Registered: ‎08-28-2013
Message 7 of 8 (590 Views)

Re: TruClient - Multiply wait time

Hi Guy,

 

But is my first assumption correct? Can I use this as a think time?

And will the transaction response times measured during test then include or exclude this minimum step time?

If it is included, can I filter it out during analysis of the test results?

 

Regards,

Peet

HP Expert
Guy_Rosenthal
Posts: 248
Registered: ‎10-24-2011
Message 8 of 8 (587 Views)

Re: TruClient - Multiply wait time

[ Edited ]

Hi Peet,

You may find this article useful regarding your first question and in general:

http://h30499.www3.hp.com/t5/HP-LoadRunner-and-Performance/Times-timing-and-timeouts-in-TruClient/ba...

 

This is indeed can be filtered in the analysis as think time.

 

 

Guy Rosenthal
TruClient RnD Team Manager
TruClient-StormRunner Load RnD
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.