On 12/11/2009, Kshitij Barve <[email protected]> wrote: > > Hi, > I want to write an user defined function to check if data bases are > synchronized or not. Here is the brief - > > There are 2 databases - Master and Slave. All Write methods writes to Master > database, and all read methods points to slave. Slave gets updated after > every 2 seconds. So if I try to get the record that I have created recently, > then I don't get it. Because record is yet not available on Slave for read. > To overcome this, I have written a BeanShell sampler. But I have to use the > same code everywhere. > So a function will definitely help me in this case.
You probably need a sampler rather than a function. > Modify logic at one place and you are done. So create a BeanShell script file and use the file rather than the script field in the GUI. Or create a BeanShell init script containing a suitable method and load it via the property: beanshell.sampler.init=<scriptname> > Any pointers will definitely help me. This is described in the manual. > Regards, > Kshitij > > > sebb-2-2 wrote: > > > > On 11/11/2009, Kshitij Barve <[email protected]> wrote: > >> > >> Hi, > >> > >> I want to write an user defined function in JMeter. And would like to > >> use it > >> in my test plan. Any pointers or example will help me a lot. > > > > The source code is available and provides lots of examples, see: > > > > > http://svn.apache.org/repos/asf/jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/ > > > > or have a look at the files in the source download archive. > > > > It would help the mailing list if you could provide brief details as > > to what the function needs to do - maybe someone else has already > > implemented it. > > > >> Regards, > >> Kshitij > >> > >> > >> -- > >> View this message in context: > >> > http://old.nabble.com/How-to-Write-a-user-defined-function-in-JMeter-and-call-it-in-the-test-plan-tp26299085p26299085.html > >> Sent from the JMeter - User mailing list archive at Nabble.com. > >> > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [email protected] > >> For additional commands, e-mail: [email protected] > >> > >> > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > > > > > > -- > View this message in context: > http://old.nabble.com/How-to-Write-a-user-defined-function-in-JMeter-and-call-it-in-the-test-plan-tp26299085p26313872.html > > Sent from the JMeter - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

