Difference (UserStatistics function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (match syntax table to syntax template, tags and edits)
Line 13: Line 13:
<td>An older <var>UserStatistics</var> object variable for the same user login as <var class="term">userStatistics</var>.</td></tr>
<td>An older <var>UserStatistics</var> object variable for the same user login as <var class="term">userStatistics</var>.</td></tr>
<tr><th>string</th>
<tr><th>string</th>
<td>This case-independent string contains the name of a <var class="product">Model 204</var> user Login statistic.  All other names return an UnknownStatistic exception.</td></tr>
<td>This case-independent string contains the name of a <var class="product">Model 204</var> user Login statistic.  All other names return an <var>[[UnknownStatistic_class|UnknownStatistic]]</var> exception.</td></tr>
</table>
</table>



Revision as of 00:01, 26 March 2011

Difference in login statistics (UserStatistics class)

The Difference function returns the difference in Login (also called "Final") statistic values between one UserStatistics object and another.

Syntax

%number = userStatistics:Difference( ustatOld, string) Throws UnknownStatistic

Syntax terms

%number A numeric variable to contain the difference between the values of the specified statistic contained in the method object and contained in the older UserStatistics object.
userStatistics A UserStatistics object variable.
ustatOld An older UserStatistics object variable for the same user login as userStatistics.
string This case-independent string contains the name of a Model 204 user Login statistic. All other names return an UnknownStatistic exception.

Usage notes

  • Difference cancels the request if it is applied to a statistic that is exclusively a "Request statistic".
  • The statistics UpdtTime(MS) and LongupdTime(MS) can also be specified without the parentheses: for example, UpdtTimeMs and LongUpdtimeMs, respectively.
  • Request statistics are not valid for Difference since most don't really make sense for this operation. The Request statistics for which it does make sense (CPU, for example) have corresponding Login statistics that return the exact same difference.
  • Some statistics (like PCPU) don't really make sense as a difference but Difference returns a difference anyway.

Examples

  1. The following example returns the amount of CPU a request uses and how many DKRDs it did:

    begin %statStart is object userStatistics %statEnd is object userStatistics %statStart = new ... processing %statEnd = new printText CPU: {%statEnd:difference(%statStart, 'CPU')} printText DKRDs: {%statEnd:difference(%statStart, 'DKRD')} end

See also