Mike,

I'm writing some functions to generate sequential and random numbers 
with the ability to re-seed the random number generator, so that after 
the first sequential or random number the following random numbers will 
be repeatable. This allows me to generate repeatable pseudo-random data.

Rather than making this one function with lots of arguments, I wanted to 
split it up into more frendly smaller functions, for example: 
${__seq(setSeed)}, ${__rand(max, setSeed)}.

I have two minor problems:

1. I wrote the functions as inner classes, since they are closely 
related and need to share data. However the call to 
ClassFinder.findClassesThatExtend() in CompoundFunction.java does not 
discover inner classes. This is easily fixed by adding a boolean "true" 
argument.

2. My functions are being called twice for each variable substitution, 
which means that I only get every other sequential number in my test 
data. replaceValues() in TestCompiler.java is called twice from 
configureSampler() [directly from line 115 and indirectly via 
layeredElement() on line 123]. I have not found an easy way to stop the 
duplicate call in configureSampler(). Instead I am keeping a WeakHashMap 
in my function's execute() methods that detects if it is called with the 
same SampleResult, but this is a bit messy.

//derek


Mike Stover wrote:

>Users,
>     There is a new unstable release -> 1.7.2.  It seems pretty solid so far, and I 
>have more 
>confidence in it at this point than the previous production release (1.7).  
>
>Developers/power users,
>       I've made a first pass at the GUI elements related to the new functions.  
>There is a 
>brief doc page about functions (only in CVS, not on website).  User
>defined variables can be created in the TestPlan GUI element, and a dialog can
>assist you in generating the correct syntax for your function calls.  The dialog is
>available from the "Options" menu.  Currently, there is only one function implemented 
>(but it's 
>an interesting one). 
>
>Creating new functions should be easy and fun (hint, hint).  You don't need to write 
>any GUI 
>code.  Just follow the directions in the JavaDocs for the 
>org.apache.jmeter.functions.Function 
>interface.  Also org.apache.jmeter.functions.AbstractFunction, which you may want to 
>extend.
>
>--
>Michael Stover
>[EMAIL PROTECTED]
>Yahoo IM: mstover_ya
>ICQ: 152975688
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
>________________________________________________________________________
>This e-mail has been scanned for all viruses by Star Internet. The
>service is powered by MessageLabs. For more information on a proactive
>anti-virus service working around the clock, around the globe, visit:
>http://www.star.net.uk
>________________________________________________________________________
>
>  
>

-- 
___________________
Derek Baum
Paremus Limited
+44 (0)20 7936 9396
www.paremus.com





________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to