extractRequestStatistics

extractRequestStatistics(proc:          Process output;
                         jdo:           JadeDynamicObject input;
                         localOrRemote: Integer;
                         any:           Any);

The extractRequestStatistics method of the Process class extracts request statistics from the userInfo part of notifications sent in response to sendRequestStatistics method requests. The extracted statistics are inserted as attributes in a JadeDynamicObject instance.

The parameters for the extractWebStatistics method are listed in the following table.

Parameter Description
proc An output parameter that receives a reference to the Process instance to which the statistics relate
jdo A JadeDynamicObject instance into which the statistics values are placed as attributes
localOrRemote To extract local request statistics (event type Process_Local_Stats_Event), set to one (1), or to extract remote request statistics (event type Process_Remote_Stats_Event), set to two (2)
any The userInfo part of the notification that was received

The calling process is responsible for creating the JadeDynamicObject instance that is used as the jdo parameter. Any existing attributes that the instance has are cleared every time the method is called.

For a list and explanations about the properties that are returned by this method, see "Process::getRequestStatistics Method", in Chapter 4 of the JADE Object Manager Guide.

If the any parameter is not recognized as containing encoded Web statistics values, a 1000 exception is raised (Invalid parameter type), a 1002 exception is raised (Invalid parameter value), or a 1137 exception (An internal data packet inconsistency was detected) is raised. This could happen if the any parameter is not the userInfo part of a notification received in response to a sendRequestStatistics request.

The following examples show methods for a form to obtain and display information about local and remote request statistics.

load() updating;
begin
    //register to receive local and remote process request statistics
    beginNotification(process, Process_Local_Stats_Event,
                      Response_Continuous, 0);
    beginNotification(process, Process_Remote_Stats_Event,
                      Response_Continuous, 0);
end;

unload() updating;
begin
    //register to receive local and remote process request statistics
    beginNotification(process, Process_Local_Stats_Event,
                               Response_Continuous, 0);
    beginNotification(process, Process_Remote_Stats_Event,
                      Response_Continuous, 0);
end;

userNotify(eventType: Integer; theObject: Object; eventTag: Integer;
           userInfo: Any) updating;
begin
    if eventType = Process_Local_Stats_Event then
        displayRequestStats(1 /*local*/, userInfo);
        return;
    elseif eventType = Process_Remote_Stats_Event then
        displayRequestStats(2 /*remote*/, userInfo);
        return;
    endif;
    //...any other notification handling goes here...
end;

displayRequestStats(localOrRemote: Integer; any: Any);
vars
    targetProcess: Process;
    jdo : JadeDynamicObject;
begin
    create jdo transient;
    process.extractRequestStatistics(targetProcess, jdo,
                                     localOrRemote, any);
    if localOrRemote = 1 then
        write "Local Request Statistics for " & targetProcess.String;
    else
        write "Remote Request Statistics for " & targetProcess.String;
    endif;
    write jdo.display;
epilog
    delete jdo;
end;

askForLocalRequestStats(targetProc: Process);
begin
    targetProc.sendRequestStatistics(1);
end;

askForRemoteRequestStats(targetProc: Process);
begin
    targetProc.sendRequestStatistics(2);
end;