BAZLEY, Sebastian wrote:
-----Original Message-----
From: Jean-Denis Giguere [mailto:[EMAIL PROTECTED]
Sent: 02 July 2004 13:52
To: JMeter Users List
Subject: BeanShell


Hi list,

I would like to use the __BeanShell function but I don't find answers to my questions in the jmeter doc. If someone use this function and can answer my questions, it will be really appreciated.

1. Which way can we pass the script in argument ? (Ralative path from where we launch jmeter, relative path from jmeter bin, absolute path or you have to write directly the script as argument ?)


The script parameter is just that - a script, not a file containing a
script.


2.Can we pass arguments to the script ?
(ex. ${__BeanShell(myscript.bsh foo 13,answer)}


You can use function calls in the script paramater string.


4. Can we pass the name of the script as a variable ?
(ex. ${__BeanShell(${myScript},answer)}


See 1. The script does not have a "name". But you can pass a script in a
variable.


3. The doc says that this function return the "result" of the script passed in argument. How do you define the result of the script ? (Is it the last variable assignation, the return of the main function, the last print ?)


See the BeanShell documentation for details, but IIRC, it will use the
return value or failing that the last assignment (it may even return the
last value).


If someone has an exemple and would accept to share it (with the function call and the result), it can help me very much.


${__BeanShell(return "abcd";)} -> abcd

${__BeanShell(return "${__threadNum()}";)} -> same as ${__threadNum()}

${__BeanShell(return Threads.currentThread().getName();)} should return the
current thread name

I think you can probably omit the return statement - try it and see.

Note that the current implementation is not as efficient as it could be -
the script is parsed anew each time, even if it has not been changed.

What do you want to use it for?

I am testing a Web Mapping Service (WMS). A wms is a cgi that returns an image (a map). In general, the most important part of the request time is the creation of the map by the cgi. When you want to ceate the map, one of the crucial parameter is the geographic bounding box of the request. I will use the bean shell function to : select the random location, specify a scale, calculate the bounding box.


I'm not sure that is the best way to do this, but I have also to simulate the fact that most frequent operation is the zoom. (Keep the same random location, but change the scale). Before, I try to generate a list of bounding box and read them from file. But it seems hard to make sure that, by exemple, the 6 next entries will be read by the same thread (1 entries = 1 bounding box) which is crucial to represent correctly the way wms is use and get significative time.

Also, need a new location for every users, beause the use of the same location use images in cache and this situation happen rarely in reality.

If you want to see a WMS in action, you can go to this site :
http://atlas.gc.ca/site/english/maps/environment/hydrology/drainagebasins

Currently, I don't test the interface, but the server that produces the map itself.




Thank you for your attention,

Jean-Denis Gigu�re


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




___________________________________________________________________________

This e-mail and the documents attached are confidential and intended solely
for the addressee; it may also be privileged. If you receive this e-mail in
error, please notify the sender immediately and destroy it. As its integrity
cannot be secured on the Internet, the Atos Origin group liability cannot be
triggered for the message content. Although the sender endeavours to maintain
a computer virus-free network, the sender does not warrant that this
transmission is virus-free and will not be liable for any damages resulting
from any virus transmitted. ___________________________________________________________________________



--------------------------------------------------------------------- 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]



Reply via email to