Get Grinder on roll – Setup Guide

Setting up the Performance testing open source tool Grinder is pretty simple, you need to do the followings to get it on roll:

  1. Download the Grinder and unzip in specific directory
  2. Example directory contains few examples, you can copy the the file either to grinder home directory or alternatively you can create <project_name> directory in root folder and then place the files in it.
  3. Update the files as per your need. You can refer the comments put up for each property in property file. If you need further explanation, just drop your query in comment section of this post.
  4. You must have Java 5 or later. Set the appropriate java paths.
  5. Create the following batch/sh files:
  6. setGrinderEnvironment.cmd or
  7. @ echo off
    Set GRINDERHOME=<full path to your Grinder home>
     / full path if file is outside grinder home>
    Set CLASSPATH=%GRINDERHOME%\lib\grinder.jar;%CLASSPATH% <also set other jar files if required>
    export GRINDERHOME=<full path to your grinder home>
    export GRINDERPROPERTIES=$GRINDERHOME/<path of / full path if file is outside grinder home>
    export CLASSPATH=$GRINDERPATH/lib/grinder.jar:$CLASSPATH <also set other jar files if required>
  8. runConsole.cmd or
  9. call <full path of setGrinderEnvironment.cmd>
    java -classpath %CLASSPATH% net.grinder.Console
    . <full path to>
    java -classpath $CLASSPATH net.grinder.Console
  10. runProxy.cmd or
  11. call <full path to setGrinderEnvironment.cmd>
    java -classpath %CLASSPATH% net.grinder.TCPProxy -console -http > <script name e.g.>
    . <full path to>
    java -classpath $CLASSPATH net.grinder.TCPProxy -console -http >
  12. runAgent.cmd or
  13. call <path to setGrinderEnvironment.cmd>
    echo %CLASSPATH%
    java -classpath %CLASSPATH% net.grinder.Grinder %GRINDERPROPERTIES%
    . <path to>
    java -classpath $CLASSPATH net.grinder.Grinder $GRINDERPROPERTIES
  14. Start the proxy using runProxy.cmd or for windows and linux respectively. Set the proxy in your browser. Default proxy is localhost:80, so set the host as localhost and port as 80 in proxy settings.
  15. Run your application, and execute the steps you would like to record. Once completed, stop the proxy by clicking the stop button of proxy console panel. 
  16. Check the file, you can see the recorded session over here. Make sure to have the same file in file what you have just recorded for playback.
  17. Start the playback session using runAgent.cmd or command for windows and linux respectively.
  18. Check the performance and errors of your playback session in logs directory (logs directory path is configured in your file). Data file represents test performance stats and error shows the error thrown during the test.

You know, comment floor is all yours. I would appreciate, if you make use of it.