$Slstats

From m204wiki
Jump to navigation Jump to search

The $Slstats function lets you evaluate the relative expense of different processes in a single request by resetting the recording of since-last statistics at the point in a request where the function call appears.

Syntax

The format of the $Slstats function is:

$Slstats(['string' | %variable])

Model 204 uses the first four characters in the quoted string, or in the current value of the %variable, as a label to identify the section of the request to which the corresponding since-last audit trail entry applies.

The default value for the argument is EVAL. Because the recording of since-last statistics begins automatically with request execution, the first set of since-last statistics in the audit trail for any request is always be labelled EVAL. This is true even if the first statement in a request contains a $Slstats call.

Usage notes

You can call the $Slstats function by embedding it in a Print statement or assigning it to a %variable. For example, the following statement initiates a new set of since-last statistics (labelled FND1) for the remainder of the request, or until the next $Slstats call appears:

%x = $slstats('FND1')

Note: Each invocation of $Slstats produces a new SMF (System Monitoring Facility) record. If the identifying label is specified, then it replaces EVAL in the SMF record, as it does in the audit trail.

In addition to EVAL, there are several other labels generated by Model 204 for audit trail and SMF records. These include:

CMPL COPY DUMP EDIT LOAD REST

You can assume any label not listed above to be generated by an $Slstats call. (Note, however, that there is no prohibition against using the above labels with $Slstats.) For accounting purposes, any label generated by $Slstats should be included as EVAL statistics.