The mlreplay utility is a tool used to replay MobiLink protocol information that is recorded by the MobiLink server.
mlreplay [options] [name=value [name2=value2...]] [[dll_name] filename]
Use this to read in options from the specified environment variable or configuration file. If both exist with the same name, the environment variable is used. See Configuration files.
To protect passwords or other information in the configuration file, you can use the File Hiding utility to obfuscate the contents of the configuration file. See File Hiding utility (dbfhide).
|-ap||Adjust the progress of synchronizations being replayed in a replay session so that the mlreplay utility does not cause progress offset mismatch warnings on the MobiLink server and adjust sequence numbers to avoid sequence number errors.|
|-f time_scale_factor||A multiplier evenly applied to recorded times.|
|-ldt last_download_time||Specify the last download time to send to the MobiLink server during the replay session. If the recorded protocol being replayed contains multiple synchronizations (this is possible if a persistent connection was recorded) only the first last download time is replaced; the rest will be replaced by the last download time the MobiLink server sends mlreplay during the replay session. Even if the -ldt option is not used, mlreplay replaces the last download time in all but the first synchronization with the last download time received from the MobiLink server during the replay session. A last download time can also be specified using the simulated client information file (when the -sci option is used) or by the IdentifySimulatedClient callback when a DLL is provided.|
|-ls||Log the total running time, total time spent replaying, the total number of repetitions that either completed successfully, failed, or skipped for each simulated client. mlreplay still logs this information before exiting even when this option is not specified.|
The number of simulated clients to run. The minimum is 1.
This option can be used with the -sci option when the number of simulated clients specified by -n less than or equal to the number of simulated clients in the simulated client information file. When used together, -n specifies the number of simulated clients run. These options allow one simulated client information file, specifying x number of simulated clients, to replay a protocol with 1 to x simulated clients.
|-o file||Log command line options and output messages to the specified file.|
|-os size||Limit the maximum size of a log file. When the log reaches the specified size (minimum 10 KB), it is renamed to YYMMDDxx.rlg and a new log file is started with the original name.|
|-ot file||Truncate the log file. Log command line options and output messages to the specified file.|
|-p password||Replace passwords with the given password.|
Ping a MobiLink server to determine whether or not the server is ready to receive synchronizations. By default, mlreplay pings the server for 60 seconds.
If the -ping option is used, the following return codes are valid:
|-r remote ID||Replace remote IDs with the given remote ID. This option cannot be used with the -rg option.|
|-rep number_of_repetitions||Specify the number of times simulated clients should replay the recorded protocol. Each repetition can be customized if a replay DLL/shared object is used. When using the generated replay API, the GetUploadTransaction, GetDownloadApplyTime, ReportEndOfReplay, and DelayStartOfReplay callbacks are called for each repetition.|
|-rg||Replace remote IDs with a GUID.|
Instruct simulated clients to start new repetitions of protocol replays until the given number of seconds is reached. Simulated clients are not stopped but no additional repetitions are started.
When specified, the numRepetitions parameter of any API callbacks is set to 0
|-rp pattern||Replace the given pattern in usernames, passwords, and remote IDs specified on the command line with the simulated client number.|
Provide mlreplay with a list of user names, passwords, remote IDs, last download times, and script versions to use for replaying. mlreplay creates a simulated client for each line in the file to replay the recorded protocol with that client information. The format of each line should be: [username],[password],[remote ID],[last download time],[script version]. The format of the last download time should be yyyy-MM-dd hh:mm:ss.SSS. If the username, password, last download time, or script version fields are left blank, mlreplay uses the corresponding values in the recorded protocol. If the remote ID is left blank, mlreplay replaces the remote ID with a GUID. The -u, -p, -r, -rg, -ldt and -sv options cannot be used with this option nor can a DLL.
This option can be used with the -n option when the number of simulated clients specified by -n is less than or equal to the number of simulated clients in the simulated client information file. When used together, -n specifies the number of simulated clients run. These options allow one simulated client information file, specifying x number of simulated clients, to replay a protocol with 1 to x simulated clients.
|-sv script version||Replace script versions with the given script version.|
|-u user name||Replace user names with the given user name.|
|-x stream(opts)||The protocol stream and stream options to use to connect to the MobiLink server. The liveness timeout can be set with this option and is automatically adjusted based on what the MobiLink server is using.|
The optional dll_name parameter is the name of the replay DLL you want mlreplay to use. The replay DLL is compiled from the Replay API. See MobiLink Generated Replay API utility (mlgenreplayapi).
The name=value pairs are like command line arguments for the replay API. They are accessible in all mlreplay callbacks and can be used to customize the behavior of the replay DLL. They are only used if a replay DLL is used. For example, to use the same replay DLL to perform synchronizations to different databases (with different instances of mlreplay) and at the end of the synchronizations you want to connect to the database to make sure the data was upload successfully, you could use a name=value pair to specify the connection string for the database rather than hard coding it in the replay DLL.
Each recorded file is called a recorded protocol file. Everything received from the start of a connection until the end of that connection is recorded in a separate recorded protocol file. Each recorded protocol file is named recorded_protocol_x.mlr where x is the job ID. The MobiLink server -rp option is used to specify that the MobiLink server should record all MobiLink protocol it receives from its clients. See -rp mlsrv16 option.
In addition to the data sent to and from the MobiLink server, the recorded protocol file also contains timing information so that mlreplay can replay the recorded protocol information exactly as it was originally performed. The timing information is also used to try to make the simulated client take the same amount of time as the original client.
By default, mlreplay plays back the recorded protocol file without any changes. However, you can customize the replay session using different options. The simulated client information consists of the username, password, remote ID, last download time, and script version. This information can be customized using the -u, -p, -r (or -rg), -ldt, and -sv options respectively.
The mlreplay utility can replay a recorded protocol file concurrently using multiple different simulated clients. There are three ways to do this:
Using only the command line You can concurrently replay a recorded protocol file by using a combination of the options -n, -u, -p, -sv, -r, -rg, and -rp. The -n option is used to specify the number of simulated clients, whereas -u, -p, -sv, -r and -rg are used to specify information about each client. By default, you can specify an asterisk (*) when using -u, -p, -sv, and/or -r (as many times as you want), to tell mlreplay to replace the asterisk with the simulated client number. You can change the asterisk to any other character using the -rp option).
mlreplay -ap -x tcpip -n 2 -rp $ -u user_$ -p pwd_$ -r rid_$ -sv test_script recorded_protocol.mlr runs mlreplay with two simulated clients. Simulated client 1 has the following information:
Simulated client 2 has the following information:
The following rules are used if any of the options are omitted:
Using a simulated client information file You can concurrently replay a recorded protocol file by specifying a simulated client information file by using the -sci option. The simulated client information file is a .csv file where each line has a username, password, remote ID, last download time, and script version (in that order).
The mlreplay utility fills in any blank fields with the same rules described under the Using only the command line option.
By default, mlreplay creates a simulated client for each line of information in the simulated client information file. However, you can use the -n option along with the -sci file to limit the number of simulated clients. If your simulated client information file specifies x simulated clients, you can use the -n option to specify a number from 1 to x, so that mlreplay only uses that number of simulated clients.
Using a simulated client information file is more flexible than using just the command line but less flexible than using a replay DLL.
Using a replay DLL When using a replay DLL, you use the -n option to specify the number of simulated clients. All other information is retrieved when mlreplay calls into the user implemented callbacks. This approach provides the greatest flexibility as it allows other parts of the replay to be customized. See MobiLink Replay C++ callbacks and MobiLink Generated Replay API utility (mlgenreplayapi).
The mlreplay utility can run multiple simulated clients to replay a protocol at the command line. The number of simulated clients to run can be specified by the -n option. Use the asterisk character to denote the simulated client number when specifying usernames, passwords, remote IDs, and script versions with the -u, -p, -r, and -sv options, respectively. The username, password, remote ID, and script version for each simulated client are determined by the following rules:
When a username or password is not specified, all simulated clients use the username or password recorded in the recorded protocol file being replayed.
When a remote ID is not specified and the number of simulated clients is greater than 1, each remote ID becomes an automatically generated GUID. When the number of simulated clients is 1, the remote ID recorded in the recorded protocol file is used; you can force a GUID value with the -rg option.
When the specified username, password, or remote ID does not contain an asterisk, simulated clients use the same username, password, or remote ID. When the specified username, password, or remote ID contains at least one asterisk, simulated clients get their own unique username, password, or remote ID where each asterisk is replaced with the simulated client number.
The amount of time the original synchronization took is part of what is recorded, so mlreplay can attempt to replay the synchronization in the same amount of time.
Use the following MobiLink server options with the mlreplay utility:
-rp Use this option to specify the directory from which synchronizations are recorded for playback with the mlreplay utility.
-rrp Use this option to run the mlreplay utility when the MobiLink server starts.
-lsc Use this option to specify the connection information for the local server so the mlreplay utility can connect to the server.
Further customizations can be made to the replay session using the MobiLink Generated Replay API utility.
Discuter à propos de cette page dans DocCommentXchange.
|Copyright © 2013, SAP AG ou société affiliée SAP - SAP Sybase SQL Anywhere 16.0|