JADE provides filesmpl and tcpsmpl libraries that implement the JADE Object Manager sampling callback facilities.
The filesmpl library sends all sampling output to a specified file, and the tcpsmpl library sends all sampling output to a specified TCP/IP connection.
If the SamplingNode parameter in the initialization file is set to true and the default filesmpl library is used, automatic sampling is output to the JADE installation directory (that is, the location of the jade.exe executable program) sampling.smp file.
Each line of sampling that is output to a file is terminated with carriage return/line feed characters (0x0d/0x0a).
If you are doing automatic sampling with output sent to a file, you can specify the following parameters in the [
Parameter | Value | Description | |
---|---|---|---|
SamplingLibraryName | filesmpl | Name of the library, without the file name extension. | |
SamplingLibraryInitialization | sampling.smp | Name of the file to which output is sent. The file name has the following macro definitions, or escape characters, which enable you to generate unique file names for each node to avoid duplication. | |
%p | Process id | ||
%d | Date in ddMMyyyy format | ||
%t | Time in hhmmss format | ||
%c | Computer name | ||
%% | Percent character | ||
For example, c:\perftest%c\sampling%p%%.smp generates c:\perftestwilbur\sampling123%.smp. | |||
(continued) | When multiple sampling files are to be created and you use the macros (that is, %p, %d, %t, and %c), they are substituted with the process id, date, time, and computer name, respectively. For example, if you sample from multiple nodes and you do not specify %p macro in the file name to distinguish the sampling file of each node, an error message is generated when you output sampling to a file, advising you No %p specified. | ||
SamplingFilterFile | Not specified | Optional object filter command file name, in a user-supplied library, which is read each time the beginSample method is invoked. For more details, see "Sampling Filtering", later in this chapter. |
If you are doing automatic sampling with output sent to a TCP/IP connection, you must specify the following parameters in the [
Parameter | Value | Description |
---|---|---|
SamplingLibraryName | tcpsmpl | Name of the library, without the filename extension. |
SamplingLibraryInitialization | host,port[,localport] | TCP/IP connection parameters, which are a comma-separated list of parameters. No spaces are allowed before or after the comma separator. |
The first parameter is the host name or IP address of the host to connect to, the second parameter is the port on the remote host to connect to, and the optional third parameter is the port number or port name on the client (local) node through which you want to connect. | ||
SamplingFilterFile | Optional | Optional object filter command file name, in a user-supplied library, which is read each time the beginSample method is invoked. For more details, see "Sampling Filtering", later in this chapter. |
The sampling output of the tcpsmpl library is the same as the output of the filesmpl library, except that every line of sampling is preceded with a 4-character field indicating the length of the following data.
If you want to retain an existing sampling file (for example, you have a sampling context that was output to the default file), ensure that you define a unique name for the next sampling context, as existing files are cleared if sampling is started to a file whose path and name already exist.
The tcpsmpl and filesmpl libraries also allow "<null>" or "" as a SamplingLibraryInitialization parameter value. Specifying "<null>" or "" causes output to be suppressed.