Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | Related Pages

MqStatCtxS API

the MqStatCtxS API is used the handle statistical time data. More...

Classes

struct  MqStatCtxS
 the statistical data object More...

Typedefs

typedef MqStatCtxS MqStatCtxS
 the statistical data object

Functions

MQ_EXTERN MqStatCtxSP MqStatCtxCreate (MqSP const msgque, const MQ_STR name, MQ_INT4 count, MQ_INT2 level)
 create a MqStatCtxS object
MQ_EXTERN void MqStatCtxDelete (MqStatCtxSP *statctxP)
 delete a MqStatCtxS object
MQ_EXTERN void MqStatCtxPrint (MqStatCtxSP statctx)
 log the data of a MqStatCtxS object to stdout
MQ_EXTERN void MqStatCtxPrintCHK (const MQ_INT2 stat, MqStatCtxSP statctx)
 log the data of a MqStatCtxS object to stdout but check for MqStatCtxS level member
MQ_EXTERN void MqStatCtxCalc (MqStatCtxSP statctx, MqStatSP const stat)
 update MqStatCtxS statistical data
MQ_EXTERN void MqStatCtxCalcCHK (const MQ_INT2 stat, MqStatCtxSP statctx, MqStatSP const statistic)
 update MqStatCtxS statistical data but check MqStatCtxS level member
MQ_EXTERN MqStatSP MqStatCreate (MqSP const msgque)
 create a statistical data object MqStatS
MQ_EXTERN MqErrorE MqStatDelete (MqStatSP *statP)
 delete a statistical data object MqStatS
MQ_EXTERN MqErrorE MqStatInit (MqStatSP stat)
 initialize a statistical data object MqStatS
MQ_EXTERN void MqStatLog (const char *prefix, MqStatSP const stat)
 log a statistical data object MqStatS

Detailed Description

the MqStatCtxS API is used the handle statistical time data.

a statistical task is a collection and computation of time values in reference to an initial time.

Example:
get a statistic about the execution time of different tasks
MqStatCtxSP point1 = MqStatCtxCreate(msgque, "point1", 0);
MqStatCtxSP all    = MqStatCtxCreate(msgque, "all", 0);
MqStatSP itemTimer; // define the timer
MqErrorCheck(MqStatCreate(msgque,&itemTimer));  // create the timer
for (...) { // just a big loop
    MqStatInit(itemTimer); // init the timer
    // ... do some work
    // measure the average time between 'point1' and MqStatInit
    MqStatCtxCalc(point1, itemTimer);
    // ... do some work
    // measure the average time between 'all' and MqStatInit
    MqStatCtxCalc(all   , itemTimer);
}
MqStatCtxPrint(point1);     // print the average time between 'point1' and MqStatInit
MqStatCtxPrint(all);        // print the average time between 'all'    and MqStatInit
MqStatDelete(&itemTimer);   // cleanup
MqStatCtxDelete(&point1);   // cleanup
MqStatCtxDelete(&all);      // cleanup

Typedef Documentation

typedef struct MqStatCtxS MqStatCtxS
 

the statistical data object

Change for 2.0:
change name from char[] to MqBufferS


Function Documentation

MQ_EXTERN MqStatCtxSP MqStatCtxCreate MqSP const   msgque,
const MQ_STR  name,
MQ_INT4  count,
MQ_INT2  level
 

create a MqStatCtxS object

Change for 2.0:
add count parameter - initial value for internal counter


Generated on Tue Nov 23 16:13:06 2004 for libFreiburg by  doxygen 1.3.8-20040928