$TkStatL

From m204wiki
Revision as of 17:36, 28 January 2011 by 198.242.244.47 (talk) (Created page with "{{DISPLAYTITLE:$TkStatL}} <span class="pageSubtitle"><section begin="desc" />Retrieve statistics for all tasks into $list<section end="desc" /></span> <p class="warning">Most Si...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<section begin="desc" />Retrieve statistics for all tasks into $list<section end="desc" />

Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $TkStatL function is to be entered.

This function allows retrieval of statistics for all tasks into a $list.

The $TkStatL function accepts two argument 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:

Byte 1-10 Blanks
Byte 11-12 Binary task number
Byte 13- Returned statistics


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".

Syntax

<section begin="syntax" /> %RESULT = $TkStatL(list_identifier, stat_list, criterion) <section end="syntax" />

$TkStatL Function

%RESULT is a either a positive number, which is the milliseconds since the online was brought up, or is a negative error code.

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

$TkStatL return codes


The following program displays some statistics for all tasks:

B %DATA IS STRING LEN 255 %LIST = $ListNew %DATA = $TkStatL(%LIST, 'CPU STDEQ LKWAIT') IF %DATA < 0 THEN PRINT '$TKSTATL ERROR... RC = ' WITH %DATA STOP END IF FOR %I FROM 1 TO $ListCnt(%LIST) %DATA = $ListInf(%LIST, %I) PRINT 'TASKNUM = ' WITH $UNBIN( $SUBSTR(%DATA, 11, 2) ) PRINT 'CPU = ' WITH $UNBIN( $SUBSTR(%DATA, 13, 4) ) PRINT 'STDEQ = ' WITH $UNBIN( $SUBSTR(%DATA, 17, 4) ) PRINT 'LKWAIT = ' WITH $UNBIN( $SUBSTR(%DATA, 21, 4) ) PRINT END FOR END

  • &SFUNC

Products authorizing $TkStatL