Stress tool for your web applications. Lets you test your servlets/JSP pages. Supports sessions simulation, so you may test your real applications.
How does it work? Describe your host (set URI), define if you need sessions simulation (through cookies or URL rewriting), set parameters in case you are using post request and set hits intensity. Package simulates users activity based on the Puasson distribution. Intensity you set is an average amount hits per second (it may be non-integer, e.g. 0.5 means 30 hits per minute etc.). With the time step one second within the model time interval package calculates visitors count for this interval and generates a bundle of requests. What you will get? Statistics for successful and failed requests and raw file with data for the each request: when it was (model time) and what was response time (real time or special mark for failed requests).
Package Stress distributed as an one jar file. Main class is StressTest. So - add jar file to your class path and run Stress.StressTest. Class requires one parameter - text file described your test configuration.
E.g. (for NT):
java -classpath Stress.jar;%CLASSPATH% Stress.StressTest configuration_file
Configuration file is a text file. Each line describes one parameter
in the form of:
parameter=value
empty lines and lines starts with // or # are ignored. Current version
supports the following list of parameters:
#
# requested url. This parameter is mandatory
# E.g. host=http://your_server/index.jsp
host=your_host
#
# method (get,post). Default value is get
#
method=post
#
# Data for post request. List of elements parameter_name=value, separated
by ;
# Default value is empty (no parameters)
#
pairs=Username=scott;Password=tiger
#
# raw statistics file. By default it is stress.txt in the current directory
#
log=full_path_to_data_file
#
# cookies. Default value is empty (no cookies).
# List of cookies, separated by ;
# E.g. here is two cookies (Username and Password)
#
cookies=Username=scott,Path=/;Password=tiger,Path=/
#
# intensity of requests (requests per second)
# Default value is 1
#
intensity=0.5
#
# Time interval for test (in seconds).
# It is a model time. Default value is 600
#
interval=300
#
# timeout for individual requests (in seconds).
# It is a real time. Default value is 120
#
timeout=300
#
# Error template. Any response contains such substring
# will be counted as a failed request.
# Default value is empty.
#
error=<title>JSP error</title>
#
# enable/disable GUI panel
# Default value is 0 (disable).
#
gui=1
Sessions simulation
When you describe test configuration you can set
session simulation (through cookies or URL rewriting).
E.g. for JSWDK you may define cookies as:
cookies=SESSIONID=123456,Path=/
where 123456 is your session Id.
When you describe host, cookies and post's parameters you may use also special identificator _ID_. This identificator will be replaced by some unique string for the each request. So you can describe session Id sending. For example (JSWDK) add the following cookie description:
cookies=SESSIONID=_ID_,Path=/
and all you requests will have session Id.(Some of servers may use JWSESSIONID).
When you describe tested url, you may use some like this:
host=http://your_host/your_page.jsp;JWSESSIONID=_ID_
or
host=http://your_host/your_page.jsp;_ID_
depends on your servletrunner. Such way you can describe session support through URL rewriting.
And for your own implementation of sessions you may use _ID_ when you
describe parameters for post request (Id passed as a hidden parameter for
the form).
Raw statistics file format
Text file with comma separated values (so you may import this file into any statistical package or MS Excel). Two columns are:
time of request (it is a model time in seconds, from the beginning of
the test)
response time (it is a real time in seconds)
For failed requests the second column is:
-1 response failure
-2 response timeout
For downloading: Stress.jar