Looking for .Sleep(n) options
I’m looking at overriding the .Sleep() function in the script to provide some options. To allow entirely new sets of tests, I’d like different sleep options to:
1) Use the actual number passed to Sleep.
2) Create a range of numbers in a normal distribution around the passed numbers. These numbers would be configurable.
3) Use completely random numbers within a configurable range.
4) Ignore all numbers passed and execute the script as quickly as possible.
My questions are:
1) Is this already available in the tool and I'm just missing it?
2) Is there a downside in deriving from Control.VirtualClient to override Sleep()?
3) Can I then force the script generator to reference my VirtualClient-implementation?
Thank you,
-Steve
1) Use the actual number passed to Sleep.
2) Create a range of numbers in a normal distribution around the passed numbers. These numbers would be configurable.
3) Use completely random numbers within a configurable range.
4) Ignore all numbers passed and execute the script as quickly as possible.
My questions are:
1) Is this already available in the tool and I'm just missing it?
2) Is there a downside in deriving from Control.VirtualClient to override Sleep()?
3) Can I then force the script generator to reference my VirtualClient-implementation?
Thank you,
-Steve
This discussion has been closed.
Comments
I think that you may be able to add some overrides to virtualclient, although this is something I haven't personally tried. The first issue is that you need to place any external assemblies that you want to reference in an ANTS Load project in the ANTS Load folder before you can reference them.
The second issue is that you can only have one class inherit from VirtualClient as described here: http://www.red-gate.com/messageboard/vi ... .php?t=542
You may want to be aware that there already is a random sleep function in ANTS Load called (guess what?) RandomSleep(). RandomSleep accepts two arguments: the minimum number of milliseconds and the maximum number of milliseconds. So RandomSleep(1000,30000) will generate a random pause of between 1 and 30 seconds.
Thanks again,
-Steve