RE: [Grinder-use] Some notes on using grinder with Debian Sarge
Distributed load testing framework - Java, Jython, or Clojure scripts.
Brought to you by:
philipa
From: Philip A. <pa...@be...> - 2005-11-24 18:33:28
|
I found that with the Java 5 Beta, but the released JDK seems to work just fine. - Phil > -----Original Message----- > From: McAlister, Keith [mailto:kei...@lo...]=20 > Sent: 24 November 2005 16:33 > To: js...@ie...; grinder Use; Philip Aston > Subject: RE: [Grinder-use] Some notes on using grinder with=20 > Debian Sarge >=20 > I though Jython 2.1 has problems with Java 1.5 (and therefore so has > Grinder)?=20 >=20 > Keith McAlister >=20 > -----Original Message----- > From: gri...@li... > [mailto:gri...@li...] On Behalf Of John > Stanford White > Sent: 24 November 2005 03:43 > To: grinder Use; Philip Aston > Subject: [Grinder-use] Some notes on using grinder with Debian Sarge >=20 > Greetings, >=20 > I thought this note might be useful from those wishing to use the > Grinder on Debian Sarge x86 machines. This has all been=20 > stated before > in the Grinder manual, but I think it requires some=20 > emphasis. As usual, > "Read the manual!" >=20 > If you don't do it right, your script will bomb the moment=20 > you try to do > something fancy, like >=20 > import re >=20 > And you get something like: >=20 > >>> ImportError: no module named sre >=20 > The checklist is simple: >=20 > 1. Make sure that your java environment is correct and at=20 > least level > 1.4.2 >=20 > 2. Make sure that jython is configured correctly. Check out your > /etc/jython.conf file. By default it is not set up. Set the >=20 > python.path =3D /usr/lib/python2.1 >=20 > This works for Jython 2.1. Set the cachedir to someplace=20 > writable, e.g. > /tmp/cachedir >=20 > 3. Set up your invocation command - e.g setenv.sh properly.=20 > The first > entry in the classpath should point to the resident jython.jar - e.g > /usr/share/jython2.1/jython.jar - not the=20 > $GRINDERHOME/jython.jar. If > you don't do this - you can't import re or any other useful python > libraries. >=20 > Details: >=20 >=20 > Step 1. Make sure that your java environment is correct. I have had > trouble making the Debian "native" java work. Use either the=20 > Blackdown > JDK 1.4.2 or the Sun 1.5xx. The former exists as a deb package, the > latter as a self-extracting bin file that you can turn into a deb > package via make-jpkg and dpkg. For instructions on how to=20 > do this go > to http://www.crazysquirrel.com/computing/debian/java.jspx. >=20 > While Sun's self-extracting bin file works well, it is worth=20 > using the > Debian package installer - it simplifies maintenance in the long run. >=20 > Be sure to set up your environment variables properly (e.g. JAVA_HOME > etc.) >=20 > You can ensure the java environment is correct by typing: > > java -version >=20 > You should see something reassuring like: > java version "1.5.0_05" > or > java version "1.4.2-02" >=20 >=20 > Step 2: Install and configure jython properly. This is=20 > easily done via > the usual "apt-get install jython". The nice thing about=20 > Debian is that > apt-get install will get all the dependencies. (If I had=20 > some time, I > would create a deb grinder package - but I barely make a=20 > living). Try > out your new jython. Type: >=20 > (prompt)> jython > # > # look out for messages like "can't create cachedir" This is bad! > # Now enter: >=20 > >>> import re >=20 > If it doesn't complain then all is well. If it complains,=20 > then you have > to edit /etc/jython/jython.conf. In my case, I had too many=20 > versions of >=20 > python floating around. The two key variables to set are: >=20 > python.path =3D /usr/lib/python2.1 > python.cachedir =3D /tmp/cachedir >=20 > The latter I set because /tmp is writable by anyone, and I=20 > couldn't be > bothered to setup the proper permissions for a common directory. > The former, python.path, I set to python2.1 because that is=20 > what jython > 2.1 demands. Once you have done this, try the above experiment. The > bottom line is that you must be sure that your installation of jython > works properly. >=20 >=20 > Step 3: Fix your invocation command to put the resident=20 > jython.jar at > the beginning of the classpath. The folks at Grinder have done a > bang-up job in the distribution. They thoughtfully included=20 > jython.jar > in the distribution. For Windows, it works right out of the=20 > box. But if > you want to do anything adventurous - like using regular expressions, > you have to use the native installation of jython so that=20 > you know where > to find the python modules. It is very simple. Just make=20 > sure that the > first element of the classpath points to the native installation of > jython.jar. You do this in your setGrinderEnv.sh file e.g.: >=20 > export JYTHONHOME=3D/usr/share/jython > export CP=3D$JYTHONHOME/jython.jar:$GRINDERHOME/lib/grinder.jar: >=20 > and so on and so forth. Put the following line at the top of your > script file (like httpscript.py) >=20 > import re > (and so on and so forth) >=20 > Fire up the Grinder console and any script you might have created. > For testing purposes, I usually script a session with=20 > Yahoo.com - one or > two extra users means nothing to their servers. If your=20 > script (with the > " import re " line doesn't die at birth, you should be good to go. >=20 > Best of luck to you all, >=20 > John >=20 >=20 >=20 > -- > John Stanford White > 212-794-1551 (Home) > 646-678-1339 (Cell) > js...@ie... >=20 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep=20 > through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. =20 > DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > _______________________________________________ > Grinder-use mailing list > Gri...@li... > https://lists.sourceforge.net/lists/listinfo/grinder-use >=20 >=20 > This e-mail and any attachment is for authorised use by the=20 > intended recipient(s) only. It may contain proprietary=20 > material, confidential information and/or be subject to=20 > legal privilege. It should not be copied, disclosed to,=20 > retained or used by, any other party. If you are not an=20 > intended recipient then please promptly delete this e-mail=20 > and any attachment and all copies and inform the sender. Thank you. >=20 |