On 22/11/2007, Joseph Ribin Roy <[EMAIL PROTECTED]> wrote: > > > > Hi Sebb > > This is my function. > I checked the values comming out for the switch it would be 0, 1, 2 . and i > tried placing 3 request in simple controller also and also putting bean shell > function inside __log(). but the order of sending request is not correct
There can be no order of requests since you are using a random function. > ${__BeanShell(if(${__Random(0,10,rand)} < 6){return 0;}else if(${rand} < > 9){return 1;}else{return 2;},switchVar)}) > That won't work properly, because ${rand} will be replaced by its value before the script is executed. Either use a Java random function in BeanShell, or set the value of rand before calling the BeanShell script. > i am attaching you the logic script. am i missing something > > Joseph > > ________________________________ From: sebb [mailto:[EMAIL PROTECTED] > Sent: Thu 11/22/2007 4:50 PM > > To: JMeter Users List > Subject: Re: Proportioning of Request > > > > > > On 22/11/2007, Joseph Ribin Roy <[EMAIL PROTECTED]> wrote: > > > > hi sebb > > > > I have written a bean shell script which would return me 0,1,2 from the > > random generation. but the switch is not working fine. Its not sending > > request in expected order. I had read the issue in users mailing list. is > > it a bug > > Are you sure that the script is returning the correct values? > Add a Java Request sampler to check it, or enclose the function call in > __log(). > > e.g. ${__log(${__beanShell(function code)})} > > The Switch Controller should look like: > > Switch Controller > + Sampler 0 > + Sampler 1 > + Sampler 2 > > or you could use Simple Controller parents: > > Switch Controller > + Simple Controller > + + Sampler 0 > + Simple Controller > + + Sampler 1 > + Simple Controller > + + Sampler 2 > > > so i thought of trying through put controller. i am not still clear how can > > i proportionate using Throughput controller. can you through some light on > > this. > > Just use a TC with the appropriate percentage as the parent of each sampler: > > TC 1 (50%) > + sampler 1 > TC 2 (30%) > + sampler 2 > > etc. > > > ________________________________ > > > > From: sebb [mailto:[EMAIL PROTECTED] > > Sent: Wed 11/21/2007 9:09 PM > > To: JMeter Users List > > Subject: Re: Proportioning of Request > > > > > > > > You could try: > > > > http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Throughput_Controller > > > > You would need one as a parent of each request, and you may not get > > exactly one of the samples per loop. > > > > Otherwise, I would probably use the Switch Controller: > > > > http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Switch_Controller > > > > in conjunction with a function that returns 0,1 or 2 in the > > appropriate proportions. > > > > e.g. generate a random number between 1 and 10 (inclusive) and then > > divide into suitable portions: > > > > 1-5 -> 0 > > 6-8 -> 1 > > 9-10 -> 2 > > > > You could use javascript, jexl or beanshell for this. > > > > On 21/11/2007, Joseph Ribin Roy <[EMAIL PROTECTED]> wrote: > > > > > > Hi all, > > > > > > I have 3 http request. Is it possible to send it in 50:30:20 ratio. > > > Does any controller can do it. Putting it in different Thread group will > > > help in doing it [spliting the user proportion]. But I ll have to rewrite > > > other requests in all thread groups. Can any one through some light on > > > this. > > > > > > Thanks > > > Joseph > > > > > > > > > > > > The information contained in, or attached to, this e-mail, contains > > > confidential information and is intended solely for the use of the > > > individual or entity to whom they are addressed and is subject to legal > > > privilege. If you have received this e-mail in error you should notify > > > the sender immediately by reply e-mail, delete the message from your > > > system and notify your system manager. Please do not copy it for any > > > purpose, or disclose its contents to any other person. The views or > > > opinions presented in this e-mail are solely those of the author and do > > > not necessarily represent those of the company. The recipient should > > > check this e-mail and any attachments for the presence of viruses. The > > > company accepts no liability for any damage caused, directly or > > > indirectly, by any virus transmitted in this email. > > > > > > www.aztecsoft.com > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > The information contained in, or attached to, this e-mail, contains > > confidential information and is intended solely for the use of the > > individual or entity to whom they are addressed and is subject to legal > > privilege. If you have received this e-mail in error you should notify the > > sender immediately by reply e-mail, delete the message from your system and > > notify your system manager. Please do not copy it for any purpose, or > > disclose its contents to any other person. The views or opinions presented > > in this e-mail are solely those of the author and do not necessarily > > represent those of the company. The recipient should check this e-mail and > > any attachments for the presence of viruses. The company accepts no > > liability for any damage caused, directly or indirectly, by any virus > > transmitted in this email. > > > > www.aztecsoft.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > The information contained in, or attached to, this e-mail, contains > confidential information and is intended solely for the use of the individual > or entity to whom they are addressed and is subject to legal privilege. If > you have received this e-mail in error you should notify the sender > immediately by reply e-mail, delete the message from your system and notify > your system manager. Please do not copy it for any purpose, or disclose its > contents to any other person. The views or opinions presented in this e-mail > are solely those of the author and do not necessarily represent those of the > company. The recipient should check this e-mail and any attachments for the > presence of viruses. The company accepts no liability for any damage caused, > directly or indirectly, by any virus transmitted in this email. > > www.aztecsoft.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]