UserStatistics class: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
Line 29: Line 29:
that are restricted to one type or the other.
that are restricted to one type or the other.
   
   
The <i>[http://www.rocketsoftware.com/m204/productsOLD/index/documentation/v7r4/M204-System-Mgr/view Rocket Model 204 System Manager's Guide]</i> and the <var class="product">[[SirMon]]</var> documentation are good sources of information about the
The <i>[http://docs.rocketsoftware.com/nxt/gateway.dll/RKB6/system%20%26%20file%20management/m204_v7r4_system_manager.pdf Rocket Model 204 System Manager's Guide]</i> and the <var class="product">[[SirMon]]</var> documentation are good sources of information about the
available statistics (note that not all <var class="product">SirMon</var> statistics
available statistics (note that not all <var class="product">SirMon</var> statistics
are included in a <var>UserStatistics</var> object).
are included in a <var>UserStatistics</var> object).
Line 66: Line 66:


==List of UserStatistics methods==
==List of UserStatistics methods==
The [[List of UserStatistics methods|"List of UserStatistics methods"]] shows all the class methods.
The [[List of UserStatistics methods]] shows all the class methods.


[[Category:System classes]]
[[Category:System classes]]

Revision as of 00:36, 12 September 2013

Intended for performance work, the UserStatistics class is designed to replace $Stat and similar tools that return the values for selected Model 204 User statistics.

The New constructor takes a snapshot of the user stat block at the time the constructor is invoked. You then use the UserStatistics methods to extract the statistical data from the instantiated object.

The UserStatistics class is new as of Sirius Mods version 7.3.

About the UserStatistics statistics

The object holds two types of user statistics: Login and Request.

  • Login statistics (also called “Final”) are those that keep data per user since the user's most recent login. The statistics available to the Model 204 $Stat function, as well as the OBJSWAP statistic for Janus SOAP objects, are valid.
  • Request statistics are a combination of:
    • Statistics that keep the current highwater marks for some work tables per user. Model 204 documentation includes these with "since last" statistics.
    • Since last statistics, which keep data per user comprising only the user's most recent work unit (like compilation or evaluation); they are not accumulated.

Login and Request statistics are not mutually exclusive. Both Login and Request data are kept for some activities, so many statistics appear in lists of both types and are valid in all methods that are restricted to one type or the other.

The Rocket Model 204 System Manager's Guide and the SirMon documentation are good sources of information about the available statistics (note that not all SirMon statistics are included in a UserStatistics object). Where they occasionally differ in spelling the name of a statistic, the Rocket Model 204 System Manager's Guide is more likely to have what the UserStatistics methods require.

You can also view all the individual statistics contained in a UserStatistics object by applying the ToString method to it, as follows:

Print %statObject:ToString(Zeros=true)

This displays all of the Login statistics followed by all the Request statistics.
Note: The ToString method shown above can be applied implicitly: simply Print or Audit an object variable, and the ToString method is automatically applied to the object. Print %statObject is equivalent to Print %statObject:ToString.

Example

The following is a simple example that shows how much CPU a request uses and how many DKRDs it did:

b %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

Specifying a statistic that is not a User statistic, or that is not the type of statistic (Login or Request) that a method calls for, triggers an UnknownStatistic exception.

List of UserStatistics methods

The List of UserStatistics methods shows all the class methods.