beginSample

beginSample(libraryName:             String;
            initializationParameter: String): Integer;

The beginSample method of the Node class opens a new sample context for the node, begins the accumulation of sampling statistics on that node, and invokes the following entry points.

This method returns the sampling handle number used to identify the sampling context that is opened. All subsequent methods use this sampling context handle as the first parameter.

When the beginSample method is called in your application, request statistics are stored in transient memory for every process in the node until they are passed to the corresponding entry point in the user library specified in the libraryName parameter. The JADE-supplied library writes a begin process record (type 6) to the statistics file.

If you are using the filesmpl or tcpsmpl JADE sampling library, you can set the initializationParameter parameter to "<null>" or to "" so that sample values will not be output. For filesmpl, the values will not be written to a file. For tcpsmpl, the values will not be sent to a TCP/IP connection. Use this option in situations where node sampling needs to be enabled for the Process class getRequestStatistics method but no file or TCP/IP output is wanted.

For more details, see "Direct Node Sampling", in Chapter 4 of the JADE Object Manager Guide.

The following is an example of a method that manually samples node statistics.

testManualSamplingFullInterval();
vars
    coy            : Company;
    cust           : Customer;
    custDict       : CustomerByNameDict;
    samplingHandle : Integer;
begin
    samplingHandle := node.beginSample("filesmpl",
                                       "c:\temp\fullInterval%p, txt");
    node.beginIndividualRequestsLogging(samplingHandle, false,
                        true, true, true, false, 557, "fullInterval");
    coy := Company.firstInstance;
    foreach cust in coy.CustDict do
        write cust.name;
    endforeach;
    node.endIndividualRequestsLogging(samplingHandle, 557, "fullInterval");
    node.endSample(samplingHandle);
end;