Infrasctucture Stt Function Reference

Stt
Statistics gathering and display layer. By creating a statistics handle with sttNew() then calling sttBgn( hndl ) at the beginning of an event, and sttEnd( hndl ) at the end of the event, the duration and frequency of the event may be measured. A subsequent call to sttSelCat can print out the above minimum maximum and average duration and frequency along with the number of events measured. In order to accumulate stats across a number of events you must create an accumulator handle with sttNew() and at the end of the event, call sttSum( accHndl, evtHndl ) instead of sttEnd( evtHndl ). When you are finished with a statistics handle free it with sttFree( hndl ).

sttBgn     sttEnd     sttFmt     sttFmtCat     sttNew     sttSelCat    
sttSetRatSecs     sttSum     sttFree    

int  sttBgn( int hndl )
Begin a statistics period. Stamps the statistics block referenced by "hndl".

int  sttEnd( int hndl )
Mark the end of a statistics period, accumulate the statistics from the statistics block referenced by “hndl”.

int  sttFmt( char* out, char* fmt, int hndl )
Format statitics duration or rate data to the output string "out" from the statistics block referenced by "hndl" Stt formatting is like printf formatting, a percent followed by a 2 character identifier for the value to be printed.
     "cn" = STT_CNT
     "sm" = STT_MIN
     "sa" = STT_AVG
     "sx" = STT_MAX
     "rm" = STT_RMIN
     "ra" = STT_RAVG
     "rx" = STT_RMAX

int  sttFmtCat( char* out, int hndl, char* fmt )
Concatenate and format statitics duration or rate data to the output string "out" from the statistics block referenced by quot;hndl". Stt formatting is like printf formatting, a string containing normal characters with and imbedded percent followed by a 1 or 2 character identifier for the value to be printed.
     "c" = Count
     "m" = Minimum
     "a" = Average
     "M" = Maximum
     "Rm" = Rate.Min
     "Ra" = Rate.Avg
     "RM" = Rate.Max
    

int  sttNew( char* label, char* descr )
Mark the end of the src handle then accumulate the statistics in the src and add them to the target statistics block.

int  sttSelCat( int hndl, char* out, int hndl, int mask )
Concatenate statitics MinAvgMax or Rate data to the output string "out" from the statistics block referenced by “hndl”. Stt formatting mask bit names:
STT_CNT, STT_STT, STT_MIN, STT_AVG, STT_MA, STT_RAT, STT_RMIN, STT_RAVG,STT_RMAX

int  sttSetRatSecs( int handle, int value )
Set the Rate Seconds flag on the supplied handle.    The rate seconds flag is set equal to "value".    A value of '1' (one) sets the rate to be reported in events per second, a value of '0' (zero) reverts the rate reports back to events per minute.

int  sttSum( int target, int src )
Mark the end of the src handle then accumulate the statistics in the src and add them to the target statistics block.

int  sttFree( int hndl )
Free the statistics space and invalidate the handle.