SleepGenerator is a client that generates (usually many) calls of a SleepingEcho Web Service (a service that receives a message and after a period of sleep it returns it back - really an exciting service; its code is in org.bionanny.samples.SleepingEchoImpl).
The main purpose is to have enough calls that can be monitored, even the calls that can be monitored in real-time (to see so-called still-running requests). It also tests your Tomcat's configuration because it produces a *lot* of threads - so usually the Tomcat complains first but should still respond to all calls, eventually (except that some calls are cancelled because they time-out).
It makes sense to use this client only after you have deployed one or more SleepingEcho Web Services, and others. All that can be done by an Ant target deploy - see the build guide.
The SleepGenerator is started by:
build/run/run-generator [options] -f <property-file> build/run/run-generator [options] <property-file>
This actually calls the class org.bionanny.samples.SleepGenerator.
Use option -help to get (perhaps more accurate) list of all options.
|This is the main - and mandatory - option (the leading -f may be omitted). The file format is described below.|
|verbose mode (it reports every call)|
|more quiet mode|
|With this option, the client just checks the format of the input property file and prints what would be called, but does not do any real calling (but it still simulates all calls for the full time as indicated in the property file; so it can run long).|
The most important command-line parameter is the <property-file>. It defines what services to call (all of them have always the same functionality, they just sleep for a while, but they are differently named as they constitute several/many Web Services).
The file has format of a Java property file, with the following properties and rules:
sleeping.call[.<number>].<service-name> = [<how-long-to-sleep-in-millis>] sleeping.acall[.<number>].<service-name> = [<how-long-to-sleep-in-millis>]
|sleeping.endpoint = <endpoint>||http://localhost:8080/axis/services|
|sleeping.min = [<lower-limit-in-millis>]||10 ms|
|sleeping.max = [<upper-limit-in-millis>]||3*60*1000 ms|
|sleeping.repeat = [<how-many-minutes-to-keep-calling>]||0 mins|
|sleeping.shuffle = [true | yes | 1]||true|
|sleeping.verbose = [1 | true | yes | 0 | false | no]||false|
|sleeping.maxdelay = <delay-efore-a-call-is-made>||5*1000 ms|
There is a testing property file (created by Ant during the compilation time) that can be used (directly or as a template): build/data/sleepers.input. That's why, the sleep generator is usually invoked by typing:
Probably the best is to use the SleepGenerator together with a client that can show on-the-fly collected data. Such client is a cgi-bin Perl client.