Struts Tutorials:
Struts2 Tag CheckBoxList , Checkbox, Iterator, IF
Struts2 Tag Library Example
Struts2 Tiles Example
Struts2 Tiles I18N Example
Struts2 Questions
Struts Tiles I18N Example
Struts Eclipse MVC
Struts2 Tags
Struts2 Example and Tutorial
Struts MVC
Struts2 Validation
Hibernate Tutorials:
Hibernate Case Study
Class Hierarchy Persist Example
Using Hibernate Interceptor
Hibernate Questions with Answer
Hibernate Many-to-Many Mapping Example
Hibernate one-to-many Mapping Example
Hibernate and ORM tools
Spring Hibernate Example
Hibernate SessionFactory Example
Hibernate Mapping Class Hierarchy
Hibernate Questions
Hibernate SessionFactory Questions
Spring Hibernate Example:
Spring Hibernate Case Study
Written By : Amit
Title :
Form based Security Web Application
Description :
Tomcat Example More...
|
Written By : Sameer
Title :
JavaServer Faces JSF
Description :
Benefits and comparing with JSP Technology More...
|
Written By : Amit
Title :
Quartz Scheduler Example
Description :
Load on startup More...
|
Written By : Amit
Title :
Web Load Test
Description :
Grinder WEB Load Testing Framework More...
|
| Tags/Keywords : Grinder-WEB-Load-Testing-Framework - Web-Load-Test - Web-Technology Example Author : Amit Date (Year/Month/Date): 2010-07-25
Using a Load testing for my sample / example web application, using Grinder Framework/Utility
This writing will try to show steps carried out by me to load test a very simple web application
by using Grinder version 3.4, from http://grinder.sourceforge.net
Before starting to use Grinder, I need to create a very simple but doing some so to say simple
business operation, such as inserting an incremented value to a place holder column in a demo
table in my local database (I have used MySQL 5.0 here in this example).
Grinder version 3.4 when expanded, I came to see folders of my interest are examples, lib.
examples folder has the default grinder.properties file and many *.PY files, as these files
have those script for reference.
lib folder has many JAR files, and grinder.jar file is the one I am going to use, for running
net.grinder.TCPProxy ->for automatically capturing PY scripts for some of my action as a specific
user usage profile for load test.
net.grinder.Console -> for connecting to the Agent from Grinder and viewing test results and much
more factors.
net.grinder.Grinder -> the main process for running the load test and is configurable to some extend
by using grinder.properties file.
Grinder uses some of those default configurations and port numbers, and I find it okay to have those
default as it is, for my example to be load tested, as I didn't find any of those ports used by
Grinder, conflicting with my example application and web server. One may have to change these ports
if anyone faces any conflict of port or port already in use type of situation.
Before starting Grinder I had successfully deployed my example web application onto the web server
web container and started the web server successfully and tested some of the screens, those are to
be load tested.
Then I opened three separate command prompts, one for the TCPProxy (for capturing *.PY script
automatically), second one to run the console, and then the third one for running the Grinder
main program.
So let us start with the automatically capturing those script steps :
1. While using Internet Browser as the test client, I had to set the proxy as localhost:8001
as the default port for TCPProxy is 8001.
For example: while using Microsoft Internet Explorer, go to tools->internet options->Connections
->LAN Settings->check use proxy server....->address:localhost and Port: 8001->ok->ok.
For other browsers, I think one can easily find how to set up proxy address and port to use.
2. Move to the GRINDER_HOME/examples folder and executed following command:
java -cp ../lib/grinder.jar;%classpath% net.grinder.TCPProxy -http > test.py
Just to see some of those command line statements, and Engine initialised:....
3. Open browser and enter the complete test URL and perfomr some of those actions, those are to
be used as user usage pattern under load testing.
4. Once done with all the user action, just shut down TCPProxy program by CTRL+C, and see
Engine exited as the output statement on console screen.
5. Now open the script, (that is test.py in this example), using your text editor application.
6. There will be many lines of code and pretty straight forward too.
Then move onto the other command prompt, for starting the console screen, I have used following
command :
Before starting this command make sure to go to the Grinder Home directory/examples folder.
java -cp ../lib/grinder.jar;%classpath% net.grinder.Console
So there will be a Console screen from Grinder utility show up with the first button with tooltip
text as "Start the worker processes", is disabled.
This means console has not detected any Grinder Main process, yet.
So we can start Grinder main program by using a command as follows, in the third command prompt:
Before starting this command make sure to go to the Grinder Home directory/examples folder.
and edit grinder.properties file for making the test.py file to be picked up by default.
The entry is "grinder.script = test.py".
java -cp ../lib/grinder.jar;%classpath% net.grinder.Grinder
There will be a statement such as "waiting for console signal" shows up, then go to the
Console screen, just to observe that the GUI button for starting the worker processes, enabled.
So by clicking that enabled button, one can start the load testing with the application
specific script.
On the Console from Grinder, there are multiple Tabs such as Graphs, Results, Processes, are
having much needed details about the running load test and these data can be saved and analysed
in many different ways.
This is just my experience with Grinder so far, and for details please visit Grinder's Official
web site.
| |