Documentation Archive Developer
Search
PATH  Documentation > WebObjects 4.5 > Deploying WebObjects Applications

   

Playing Back a Session

Once you have recorded a session with your application, you can use the Playback command-line tool to simulate users accessing the application. This Java tool is part of the PlaybackManager project, which must be compiled for the tool to exist.

To play back a recorded session:

  1. Add the following directory to your CLASSPATH environment variable:
  2. NEXT_ROOT/Library/WebObjects/Applications/PlaybackManager.woa/WebServerResources/Java
  3. In a separate shell, start the application as you normally would (do not use the -WORecordingPath flag here). When you start the application you can use adaptors or direct connect.

  4. Start the Playback java tool by entering a command similar to the following:
  5. 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 ".:$NEXT_ROOT/Library/WebObjects/Applications/PlaybackManager.woa/WebServerResources/Java:`javaconfig DefaultClasspath`" com.apple.client.playback.Playback -r /tmp/tape1.rec

The 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:

-h hostname

Sets the host to send the requests to (the default is localhost ).

-p adaptorPath

Sends requests using the specified adaptor path instead of the recorded URL. For example, suppose you recorded a session using a Netscape server whose cgi-bin directory is named cgi-bin and you want to play it back using the Microsoft Internet Information Server, whose cgi-bin directory is named Scripts and whose adaptor is named WebObjects.dll . Your adaptor path is /Scripts/WebObjects.dll.

-port portNumber

Sets the port the requests are sent to (the default is 80).

-c limit

Limits the number of times to repeat the session playback (there is no limit by default).

-s sleepTime

Sets the interval between requests in seconds (the default is zero).

-diff percents

Sets the percentage difference between received and recorded response sizes (the default is 5%).

-d

Turns debugging on.

-r recordingDir

Sets the recording directory.

-help

Prints a summary of options

Here is an example of a command beginning a playback session using direct connect:

java -classpath com.apple.client.playback.Playback -d -h mymachine -r /tmp/tape1.rec -port 3456 -diff 20

Additional information on the Playback Manager can be found in NEXT_ROOT /Library/WebObjects/Applications/PlaybackManager.woa/Resources/ReadMe.html .


© 1999 Apple Computer, Inc. – (Last Updated 25 August 99)