$SsStatL: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:$SsStatL}} <span class="pageSubtitle"><section begin="desc" />Retrieve statistics for set of subsystems into $list<section end="desc" /></span> <p class="warning"...")
 
m (link repair)
 
(38 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:$SsStatL}}
{{DISPLAYTITLE:$SsStatL}}
<span class="pageSubtitle"><section begin="desc" />Retrieve statistics for set of subsystems into $list<section end="desc" /></span>
<span class="pageSubtitle">Retrieve statistics for set of subsystems into $list</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $SsStatL function is [[to be entered]].</p>
<p class="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the $SsStatL function.</p>


This function allows retrieval of statistics for a set of subsystems into a $list.  
This function allows retrieval of statistics for a set of subsystems into a $list.  


The $SsStatL function accepts three arguments and returns a numeric error code.  
The <var>$SsStatL</var> function accepts three arguments and returns a numeric error code.  


The first argument is the identifier of the $list that is to receive the results. The current contents of the $list are deleted and replaced with the requested statistics. The format of each $list item is:
==Syntax==
<table class="syntaxTable">
<p class="syntax"><span class="term">%result</span> = <span class="literal">$SsStatL</span>(<span class="term">list_identifier</span>, <span class="term">stat_list</span>, <span class="term">criterion</span>)
</p>
 
===Syntax terms===
<table>
<tr><th>%result</th>
<td>Either a positive number (milliseconds since the online was brought up) or a negative error code.</td></tr>
 
<tr><th>list_identifier</th>
<td>The identifier of the $list that is to receive the results. The current contents of the $list are deleted and replaced with the requested statistics. The format of each $list item is:
<table class="thJustBold">
<tr><th>Byte 1-10</th>
<tr><th>Byte 1-10</th>
<td>Blank padded subsystem name</td></tr>
<td>Blank padded subsystem name</td></tr>
<tr><th>Byte 11-12</th>
<tr><th>Byte 11-12</th>
<td>Always 0</td></tr>
<td>Always 0</td></tr>
<tr><th>Byte 13-</th>
<tr><th>Byte 13-</th>
<td>Returned statistics
<td>Returned statistics</td></tr>
</td></tr></table>
</table></td></tr>


<tr><th>stat_list</th>
<td>A string of blank delimited words indicating the statistics to be returned. The length of each returned statistic is always a multiple of 4 bytes. This facilitates the use of <var>[[$StatLD]]</var> with the returned $list. For more information about available statistics, see [[Subsystem statistics displayed in SirMon]]. </td></tr>


The second argument is a string of blank delimited words indicating the statistics to be returned. The length of each returned statistic is always a multiple of 4 bytes. This facilitates the use of $StatLD with the returned $list. For more information about available statistics, see the ''"SirMon User's Guide"''.
<tr><th>criterion</th>
<td>A selection criterion that indicates which files are to be included in the output $list. The following criteria are allowed:


The third argument is a selection criterion that indicates which files are to be included in the output $list. The following criteria are allowed:
<table>
<table class="syntaxTable">
<tr><th><var>FILE=</var>filename</th>
<tr><th>FILE=filename</th>
<td>Include only subsystems that have opened file <var class="term">filename</var>.</td></tr>
<td>include only subsystems that have opened file '''filename'''.</td></tr>
 
<tr><th>SUBSYS=subsysid</th>
<tr><th><var>SUBSYS=</var>subsysid</th>
<td>include only subsystems with names matching '''subsysid''' (wildcards allowed).
<td>Include only subsystems with names matching <var class="term">subsysid</var> (wildcards allowed).</td></tr>
</td></tr></table>
</table>
In actual fact, all files are always included in the output list, but the excluded subsystems have the high order bit of byte 11 turned on. This tells $StatLD to exclude the subsystems from the difference $list.
<p>
==Syntax==
In actual fact, all files are always included in the output list, but the excluded subsystems have the high order bit of byte 11 turned on. This tells <var>$StatLD</var> to exclude the subsystems from the difference $list. </p></td></tr>
<p class="syntax"><section begin="syntax" /> %RESULT = $SsStatL(list_identifier, stat_list, criterion)
</table>
<section end="syntax" /></p>
 
<p class="caption">$SsStatL Function
===Return codes===
</p>
<p class="code"> -3 - No room to create $list items (if LISTFC <var>$SirParm</var> parameter not set)
<p class="caption">%RESULT is either a positive number (milliseconds since the online was brought up) or a negative error code.</p>
<p class="code">  
-3 - No room to create $list items
(if LISTFC $SirParm parameter not set)
  -5 - Required parameter not specified
  -5 - Required parameter not specified
  -6 - Invalid $list identifier
  -6 - Invalid $list identifier
-12 - Invalid name in stat_list
-12 - Invalid name in stat_list
-13 - STAT not linked in
-13 - STAT not linked in
-16 - Invalid selection criterion
-16 - Invalid selection criterion
</p>
<p class="caption">$SsStatL return codes
</p>
</p>


==Example==
The following program displays some statistics for all subsystems.


The following program displays some statistics for all subsystems.
<p class="code">b
<p class="code"> b
   
   
%data is string len 255
%data is string len 255
%list1 = $ListNew
%list1 = $ListNew
%list2 = $ListNew
%list2 = $ListNew
%list3 = $ListNew
%list3 = $ListNew
   
   
%time1 = $UsStatL(%list1, 'IODEV CPU')
%time1 = $UsStatL(%list1, 'IODEV CPU')
Pause 1
Pause 1
%time2 = $UsStatL(%list2, 'IODEV CPU','SUBSYS=SIRMON')
%time2 = $UsStatL(%list2, 'IODEV CPU','SUBSYS=SIRMON')
%rc = $StatLD(%list1, %list2, %list3, 'N N', %time2 - %time1)
%rc = $StatLD(%list1, %list2, %list3, 'N N', %time2 - %time1)
   
   
For %i from 1 to $ListCnt(%list3)
For %i from 1 to $ListCnt(%list3)
%data = $ListInf(%list3, %i)
  %data = $ListInf(%list3, %i)
Text
  Text
userid = { $substr(%data,1,10) } -
    userid = { $substr(%data,1,10) } -
usernum = { $unbin($substr(%data,11,2)) } -
    usernum = { $unbin($substr(%data,11,2)) } -
iodev = { $unbin($substr(%data,13,4)) } -
    iodev = { $unbin($substr(%data,13,4)) } -
cpu total = { $unbin($substr(%data,17,4)) }
    cpu total = { $unbin($substr(%data,17,4)) }
End Text
  End Text
End For
End For
   
   
End
End
</p>
</p>
<p class="code">
<ul>
<li>&SFUNC


==Products authorizing {{PAGENAMEE}}==
<ul class="smallAndTightList">
<li>[[List of $functions|Sirius functions]]
</ul>
</ul>
</p>
<p class="caption">Products authorizing $SsStatL
</p>


[[Category:$Functions|$SsStatL]]
[[Category:$Functions|$SsStatL]]

Latest revision as of 22:11, 27 November 2017

Retrieve statistics for set of subsystems into $list

Note: Many $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the $SsStatL function.

This function allows retrieval of statistics for a set of subsystems into a $list.

The $SsStatL function accepts three arguments and returns a numeric error code.

Syntax

%result = $SsStatL(list_identifier, stat_list, criterion)

Syntax terms

%result Either a positive number (milliseconds since the online was brought up) or a negative error code.
list_identifier The identifier of the $list that is to receive the results. The current contents of the $list are deleted and replaced with the requested statistics. The format of each $list item is:
Byte 1-10 Blank padded subsystem name
Byte 11-12 Always 0
Byte 13- Returned statistics
stat_list A string of blank delimited words indicating the statistics to be returned. The length of each returned statistic is always a multiple of 4 bytes. This facilitates the use of $StatLD with the returned $list. For more information about available statistics, see Subsystem statistics displayed in SirMon.
criterion A selection criterion that indicates which files are to be included in the output $list. The following criteria are allowed:
FILE=filename Include only subsystems that have opened file filename.
SUBSYS=subsysid Include only subsystems with names matching subsysid (wildcards allowed).

In actual fact, all files are always included in the output list, but the excluded subsystems have the high order bit of byte 11 turned on. This tells $StatLD to exclude the subsystems from the difference $list.

Return codes

-3 - No room to create $list items (if LISTFC $SirParm parameter not set) -5 - Required parameter not specified -6 - Invalid $list identifier -12 - Invalid name in stat_list -13 - STAT not linked in -16 - Invalid selection criterion

Example

The following program displays some statistics for all subsystems.

b %data is string len 255 %list1 = $ListNew %list2 = $ListNew %list3 = $ListNew %time1 = $UsStatL(%list1, 'IODEV CPU') Pause 1 %time2 = $UsStatL(%list2, 'IODEV CPU','SUBSYS=SIRMON') %rc = $StatLD(%list1, %list2, %list3, 'N N', %time2 - %time1) For %i from 1 to $ListCnt(%list3) %data = $ListInf(%list3, %i) Text userid = { $substr(%data,1,10) } - usernum = { $unbin($substr(%data,11,2)) } - iodev = { $unbin($substr(%data,13,4)) } - cpu total = { $unbin($substr(%data,17,4)) } End Text End For End

Products authorizing $SsStatL