Difference (UserStatistics function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
No edit summary
 
mNo edit summary
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<span style="font-size:120%; color:black"><b>Difference of specified Login statistic value (between two U</b></span>
{{Template:UserStatistics:Difference subtitle}}
[[Category:UserStatistics methods|Difference function]]
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.
[[Category:System methods]]
<!--DPL?? Category:UserStatistics methods|Difference function: Difference of specified Login statistic value (between two U-->
<!--DPL?? Category:System methods|Difference (UserStatistics function): Difference of specified Login statistic value (between two U-->
<p>
Difference is a member of the [[UserStatistics class]].
</p>


This function returns the difference in [[UserStatistics class#login|Login]]
==Syntax==
(also called &ldquo;Final&rdquo;) statistic values
{{Template:UserStatistics:Difference syntax}}
between one UserStatistics object and another.


The Difference method cancels the request if it is applied to a statistic
[[UserStatistics class#request|Request statistic]].
===Syntax===
  %dif = %ustat:Difference(%ustatOld, statistic)
===Syntax terms===
===Syntax terms===
<dl>
<table class="syntaxTable">
<dt><i>%dif</i>
<tr><th>%number</th>
<dd>A numeric variable to contain the difference between the values of the
<td>A numeric variable to contain the difference between the values of the specified statistic contained in the method object and the one contained in the older <var>UserStatistics</var> object. </td></tr>
specified statistic
 
contained in the method object and contained in the older UserStatistics object.
<tr><th>userStatistics</th>
<dt><i>%ustat</i>
<td>A <var>UserStatistics</var> object variable. </td></tr>
<dd>A UserStatistics object variable.
 
<dt><i>%ustatOld</i>
<tr><th>ustatOld</th>
<dd>An older UserStatistics object variable for the same user login
<td>An older <var>UserStatistics</var> object variable for the same user login as <var class="term">userStatistics</var>.</td></tr>
as ''%ustat''.
 
<dt><i>statistic</i>
<tr><th>string</th>
<dd>This case-independent string contains the name of a ''Model 204'' user Login statistic
<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>
All other names return an UnknownStatistic exception.
</table>


</dl>
==Usage notes==
===Usage Notes===
<ul>
<ul>
<li>The statistics UpdtTime(MS) and LongupdTime(MS) can also be specified
<li><var>Difference</var> cancels the request if it is applied to a statistic that is exclusively a [[UserStatistics class#request|"Request statistic"]].
without the parentheses: for example,
 
UpdtTimeMs and LongUpdtimeMs, respectively.
<li>The statistics <var>UpdtTime(MS)</var> and <var>LongupdTime(MS)</var> can also be specified without the parentheses: for example, <code>UpdtTimeMs</code> and <code>LongUpdtimeMs</code>, respectively.
<li>Request statistics are not valid for the Difference method since most don't
 
really make sense for this operation.
<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 (<var>CPU</var>, for example) have corresponding Login statistics that return the exact same difference.
The Request statistics for which it does make sense (CPU, for example)
 
have corresponding Login statistics that return the exact same difference.
<li>Some statistics (like <var>PCPU</var>) don't really make sense as a difference, but <var>Difference</var> returns a difference anyway.
<li>Some statistics (like PCPU) don't really make sense as a difference but
the Difference method returns a difference anyway.
<li>The [[DifferenceToString (UserStatistics function)|DifferenceToString]] function returns the value
differences between two UserStatistics objects for the Login statistics.
The [[DifferenceToXmlDoc (UserStatistics function)|DifferenceToXmlDoc]] function returns the differences
to an XmlDoc object.
</ul>
</ul>
===Examples===


The following example returns
==Examples==
the amount of CPU a request uses and how many DKRDs it did:
The following example returns the amount of CPU a request uses and how many DKRDs it did:
<pre>
<p class="code">begin
    b
  %statStart  is object userStatistics
    %statStart  is object userStatistics
  %statEnd    is object userStatistics
    %statEnd    is object userStatistics
  %statStart = new
    %statStart = new
    ... processing
    ... processing
  %statEnd  = new
    %statEnd  = new
  [[PrintText statement|printText]] CPU:  {%statEnd:difference(%statStart, 'CPU')}
    printText CPU:  {%statEnd:difference(%statStart, 'CPU')}
  printText DKRDs: {%statEnd:difference(%statStart, 'DKRD')}
    printText DKRDs: {%statEnd:difference(%statStart, 'DKRD')}
end
    end
</p>
</pre>
 
==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}}

Latest revision as of 21:22, 20 November 2012

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 the one 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