This section focuses on recording and playing back sessions from the command line. For information on the Playback Manager application, consult the application's online help.
To run an application in recording mode:
myApplication -WOAutoOpenInBrowser NO -WORecordingPath /tmp/TestMyApp/tape1
This command creates the file /tmp/TestMyApp/tape1.rec.
You might want to record what you believe to be a typical session, or you might want to record a session that puts a maximum load on your application. For example, you may want to record a session that performs as many database fetches as possible. As you run the application, the WebObjects recording adaptor writes each request and response to the recording file.
Keep in mind that all request and responses are saved to disk, so it's recommended that only one user (that is, one session) access the application while recording is underway. You can later play back a recorded session multiple times to simulate more users.
To play back a recorded session:
java com.apple.client.playback.Playback -r /tmp/tape1.rec
The Playback class must be found in the Java classpath. When the PlayBack Manager project has been compiled, the Playback tool bytecode is in the subdirectory Playback Manager.woa/WebServerResources/Java.
Alternatively, you can explictly give the class path on the command line, as in this example:
java -classpath ".:/MyProjects/PlaybackManager/PlaybackManager.woa/WebServerResources/Ja va:`javaconfig DefaultClasspath`" com.apple.client.playback.Playback -r /tmp/tape1.recThe Playback tool plays the recorded session repeatedly until you explicitly stop it (for example, by pressing Control-C in a command shell window). You can run several instances of the tool at the same time to put more load on the server. To manage multiple instances it's better to use the Playback Manager application.
If you want, you can specify other options of the Playback tool. The following list describes these options:
java -classpath com.apple.client.playback.Playback -d -h mymachine -r /tmp/tape1.rec -port 3456 -diff 20
Table of Contents
Next Section