Difference (UserStatistics function): Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (match syntax table to syntax template, tags and edits) |
||
Line 1: | Line 1: | ||
{{Template:UserStatistics:Difference subtitle}} | {{Template:UserStatistics:Difference subtitle}} | ||
The <var>Difference</var> function returns the difference in [[UserStatistics class#login|Login]] (also called "Final") statistic values between one <var>UserStatistics</var> object and another. | |||
(also called | |||
between one UserStatistics object and another. | |||
==Syntax== | ==Syntax== | ||
{{Template:UserStatistics:Difference syntax}} | {{Template:UserStatistics:Difference syntax}} | ||
===Syntax terms=== | ===Syntax terms=== | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th | <tr><th>%number</th> | ||
<td>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. </td></tr> | <td>A numeric variable to contain the difference between the values of the specified statistic contained in the method object and contained in the older <var>UserStatistics</var> object. </td></tr> | ||
<tr><th> | <tr><th>userStatistics</th> | ||
<td>A UserStatistics object variable. </td></tr> | <td>A <var>UserStatistics</var> object variable. </td></tr> | ||
<tr><th> | <tr><th>ustatOld</th> | ||
<td>An older UserStatistics object variable for the same user login as | <td>An older <var>UserStatistics</var> object variable for the same user login as <var class="term">userStatistics</var>.</td></tr> | ||
<tr><th> | <tr><th>string</th> | ||
<td>This case-independent string contains the name of a | <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> | ||
</table> | </table> | ||
==Usage notes== | ==Usage notes== | ||
<ul> | <ul><li><var>Difference</var> cancels the request if it is applied to a statistic that is exclusively a [[UserStatistics class#request|"Request statistic"]]. | ||
<li>The statistics UpdtTime(MS) and LongupdTime(MS) can also be specified | <li>The statistics UpdtTime(MS) and LongupdTime(MS) can also be specified without the parentheses: for example, UpdtTimeMs and LongUpdtimeMs, respectively. | ||
without the parentheses: for example, | <li>Request statistics are not valid for <var>Difference</var> since most don't really make sense for this operation. The Request statistics for which it does make sense (CPU, for example) | ||
UpdtTimeMs and LongUpdtimeMs, respectively. | |||
<li>Request statistics are not valid for | |||
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. | have corresponding Login statistics that return the exact same difference. | ||
<li>Some statistics (like PCPU) don't really make sense as a difference but | <li>Some statistics (like PCPU) don't really make sense as a difference but <var>Difference</var> returns a difference anyway. | ||
</ul> | </ul> | ||
==Examples== | ==Examples== | ||
<ol><li>The following example returns the amount of CPU a request uses and how many DKRDs it did: | |||
The following example returns | <p class="code">begin | ||
the amount of CPU a request uses and how many DKRDs it did: | %statStart is object userStatistics | ||
<p class="code"> | %statEnd is object userStatistics | ||
%statStart is object userStatistics | %statStart = new | ||
%statEnd is object userStatistics | ... processing | ||
%statStart = new | %statEnd = new | ||
[[PrintText statement|printText]] CPU: {%statEnd:difference(%statStart, 'CPU')} | |||
%statEnd = new | printText DKRDs: {%statEnd:difference(%statStart, 'DKRD')} | ||
printText CPU: {%statEnd:difference(%statStart, 'CPU')} | |||
printText DKRDs: {%statEnd:difference(%statStart, 'DKRD')} | |||
end | end | ||
</ | </p></ol> | ||
==See also== | ==See also== | ||
<ul><li><var>[[DifferenceToString (UserStatistics function)|DifferenceToString]]</var> returns the value differences between two <var>UserStatistics</var> objects for the Login statistics. | |||
<li><var>[[DifferenceToXmlDoc (UserStatistics function)|DifferenceToXmlDoc]]</var> returns the differences to an <var>[[XmlDoc_API#The_XmlDoc_class|XmlDoc]]</var> object. | |||
</ul> | |||
{{Template:UserStatistics:Difference footer}} | {{Template:UserStatistics:Difference footer}} |
Revision as of 07:45, 25 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
- 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
- DifferenceToString returns the value differences between two UserStatistics objects for the Login statistics.
- DifferenceToXmlDoc returns the differences to an XmlDoc object.