10-22-2013 04:50 AM
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 ?
10-22-2013 11:59 AM - edited 10-22-2013 12:00 PM
I found this useful link from http://www.perftesting.co.uk, hope it helps.
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.