Although many types of benchmarks can be performed with real clients, it is
often desirable to remove the complexity associated with having to prepare the
applications and configure the clients. To satisfy this requirement,
you can use libraries provided by IBM WebSphere InterChange Server that
emulate connector agents.
This section discusses some of the concepts and implementations for
starting IBM WebSphere InterChange Server clients.
For an IBM WebSphere InterChange Server client to start up, it must start a
Java program and do the following:
- Load supporting classes
- Invoke the appropriate wrapper class
- Use the appropriate dynamically loadable library (DLL) for C++ connectors,
or the proper Java class for Java connectors
- Specify the name of the connector (for a connector client) or the name of
the collaboration to which the client sends objects (for an access client)
- Specify the name of IBM WebSphere InterChange Server
These actions are accomplished through startup scripts, which are similar
in function across Windows and UNIX-based systems, though there are slight
differences in implementation.
To create a benchmark connector-emulator startup script for a particular
connector, you must create a connector-emulator startup script that invokes
the following Java class for a connector emulator:
CxCommon.BenchConnector.BenchMarkConnector.
The steps to create this connector-emulator startup script depend on your
operating-system environment.
To create a benchmark connector-emulator startup script on a Windows
system, take the following steps:
- Make a copy of the connector startup script template, which is located in
the following directory:
ProductDir\templates\start_connName.bat.
Give the copy a name that suggests its role in emulating a connector for the
purpose of benchmarking (such as start_benchmark.bat) and
put it in the bin subdirectory of the product directory.
- Edit the copied startup script so that it invokes the benchmark connector
emulator's Java class.
For the Windows environment, the line in the startup-script template to
invoke a Java connector class appears as follows:
call startup_adapter.bat -nconnName
-sserverName
-lconnectorSpecificClasses
where:
- connName is the name to assign to the connector
emulator.
- serverName is the name of your InterChange Server
instance.
- connectorSpecificClasses specifies the name of the Java
connector class.
In this line, change the name of the Java-class
(connectorSpecificClasses) to the name of the Java class for the
connector emulator, so that the line appears as follows:
call startup_adapter.bat -nconnName
-sserverName
-lCxCommon.BenchConnector.BenchMarkConnector
- Save the benchmark-connector-emulator startup script.
- Configure the startup mechanism so that the name of the connector is
passed as the value to the -n parameter (connName) and the
name of the InterChange Server instance (serverName) is passed as
the value to the -s parameter.
Implement one of these three approaches to create a solution that allows you
to emulate each connector you are benchmarking:
- Hard-code the names of the connector and InterChange Server instance into
the connector-emulator startup script by replacing connName and
serverName with their appropriate values.
The advantages of this approach are that you can ensure that the case and
spelling of the values is correct, and you avoid the need to type them at the
command line each time you start the connector emulator. The
disadvantage to this approach is that it is customized to a particular
connector; if you have multiple connectors to emulate, then you must
customize a startup script for each one.
- Run the connector-emulator startup script from the command line and type
the names of the connector and InterChange Server instance each time.
For example, if your connector-emulator startup script is called
start_Benchmark.bat, you can start any connector emulator as
follows:
start_Benchmark connName serverName
In this case, you must also edit your connector-emulator startup script to
change the names of the connector and InterChange Server instance to
command-line parameters, so that the line to invoke start_adapter.bat
appears as follows:
call start_adapter.bat -n%1 -s%2
-lCxCommon.BenchConnector.BenchMarkConnector
The start_adapter.bat file is installed when the Adapter Framework is
installed. The advantage to this approach is that you can typically use
a single connector-emulator startup script for multiple connector
emulators. The disadvantage of this approach is that you must be
careful to correctly specify the names of the connector and InterChange Server
instance on the command line.
- Create a Windows shortcut for the benchmark connector-emulator startup
script.
In this case, you must edit the connector-emulator startup script so that it
accepts the names of the connector and InterChange Server instance as
command-line parameters (as described above) and then include the actual names
in the target of a Windows shortcut for the connector emulator. Use
this shortcut to invoke the connector emulator.
This approach combines the advantages of the previous two
approaches--you do not have to maintain multiple scripts for each
connector emulator, and you do not have to manually enter the names of the
connector and InterChange Server instance on the command line each time you
start the connector emulator. The disadvantage to this approach is that
it is limited to Windows systems.
To create a benchmark connector-emulator startup script on a UNIX-based
system, take the following steps:
- Make a copy of the low-level connector startup-script template, which is
located in the following directory:
ProductDir\templates\start_connName.sh
Give the copy a name that suggests its role in emulating a connector for the
purpose of benchmarking (such as start_Benchmark.sh) and put
it in the bin subdirectory of the product directory.
- Edit the copied startup script so that it invokes the benchmark connector
emulator's Java class.
For UNIX-based environments, the line in the startup-script template to
invoke a Java connector class appears as follows:
exec ${ADAPTER_RUNTIME}/bin/start_adapter.sh
-nconnName -sserverName -lconnSpecificClasses
-f... -p...
-c... ...
where:
- connName is the name to assign to the connector
emulator.
- serverName is the name of your InterChange Server
instance.
- connectorSpecificClasses specifies the name of the Java
connector class.
In this line, change the name of the Java-class
(connSpecificClasses) to the name of the Java class for the
connector emulator, so that the line appears as follows:
exec ${ADAPTER_RUNTIME}/bin/start_adapter.sh
-nconnName -sserverName
-lCxCommon.Bench.Connector.BenchMarkConnector
-f... -p...
-c... ....
The "-f... -p... -c... ..." string indicates the
position for other command-line parameters that
thestart_adapter.sh script supports. You must decide
if any of these command-line parameters are useful. For more
information on these parameters, see the System Administration
Guide.
- Save the benchmark-connector-emulator startup script.
- Configure the startup mechanism in one of the following ways so that the
name of the connector is passed as the value to the -n parameter
(connName) and the name of the InterChange Server instance
(serverName) is passed as the value to the -s
parameter.
Implement one of these three approaches to create a solution that allows you
to emulate each connector you are benchmarking:
- Hard-code the names of the connector and InterChange Server instance into
the connector-emulator startup script by replacing connName and
serverName with their appropriate values.
The advantages of this approach are that you can ensure that the case and
spelling of the values is correct, and you avoid the need to type them at the
command line each time you start the connector emulator. The
disadvantage to this approach is that it is customized to a particular
connector; if you have multiple connectors to emulate, then you must
customize a startup script for each one.
- Run the connector-emulator startup script from the command line and type
the names of the connector and InterChange Server instance each time.
For example, if your connector-emulator startup script is called
start_Benchmark.sh, you can start any connector emulator as
follows:
start_Benchmark connName serverName
In this case, you must also edit your connector-emulator startup script and
make the names of the connector and InterChange Server instance command-line
parameters, so that the line to invoke start_adapter.sh appears as
follows:
exec ${ADAPTER_RUNTIME}/bin/start_adapter.sh -n$1
-s$2
-lCxCommon.BenchConnector.BenchMarkConnector
The advantage to this approach is that you can typically use a single
connector-emulator startup script for multiple connector emulators. The
disadvantage of this approach is that you must be careful to correctly specify
the names of the connector and InterChange Server instance on the command
line.
