Infrasctucture stt Layer

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 sttCatMAM or 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     sttCatMAM     sttEnd     sttFmt     sttSelCat     sttSum    
sttFree    

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

int   sttCatMAM( char* out, int hndl )
Concatenate statitics MinAvgMax data to the supplied string from the statistics block referneced 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, 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    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    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.