Exemple #1
0
 void MamaSource::deactivateSubscriptions ()
 {
     bool activate = false;
     wtable_for_each (mySubs,
                      Wombat_MamaSource_iterateSources,
                      &activate);
 }
int printPerfReport  (statsCache* sCache,FILE* outfile)
{
    /* update stats using final interval */
    statisticsCacheToFile(sCache,NULL);
    
    if(sCache && outfile != NULL)
    {
        if(sCache->mNumMsg>0)
        {
            /* call to iterate around wTable*/
            if(outfile==stdout)
            {
                perfDataReportHeader(outfile);
            }
            wtable_for_each (sCache->mSymbolTable,wtableIteration,outfile );
        }
        else
        {
            /* just print current perfData*/
            if(outfile==stdout)
            {
                perfDataReportHeader(outfile);
            }
            sCache->mPData->mStdDeviationA =  
                 calcStdDeviation(sCache->mPData,"all");
            printPerfDataReport(sCache->mPData,outfile);
        }
        return STATS_OK;
    }
    else
    {
        return STATS_NULL_PARAM;
    }
}
Exemple #3
0
    void MamaSource::activateSubscriptions ()
    {
        /* Now iterate to change the status of the sources if necessary */
        bool activate = true;
        wtable_for_each (mySubs,
                         Wombat_MamaSource_iterateSources,
                         &activate);


    }
Exemple #4
0
    void MamaSource::forEachSubscription (MamaSubscriptionIteratorCallback* callback, 
                                          void*                             closure) 
    {
        MamaSourceSubscriptionIteratorClosure* iteratorClosure;
        
        iteratorClosure = (MamaSourceSubscriptionIteratorClosure*)calloc
                 (1, sizeof (MamaSourceSubscriptionIteratorClosure));

        iteratorClosure->mCallback = callback;
        iteratorClosure->mSource = this;
        
        wtable_for_each (mySubs,
                         Wombat_MamaSource_iterateSubscriptions,
                         (void*)iteratorClosure);

        free ((void*)iteratorClosure);
    }
void statisticsCacheToFile(statsCache* sCache,
                           performanceData* myPerformanceData)
{
    double timeIntervalInSeconds;
    struct timeval sTime;
    double timeNow;
    (void)gettimeofday(&sTime,NULL);
    timeNow= ( (double) sTime.tv_sec ) +
             ( (double)sTime.tv_usec/1000000 );                            
    if(sCache)
    {
        timeIntervalInSeconds = timeNow - sCache->mLastUpdateTime;

#ifdef WIN32
        if(timeIntervalInSeconds<0)
            timeIntervalInSeconds+=60;
#endif
        sCache->mLastUpdateTime = timeNow;
        if(sCache->mNumMsg>0)
        {
            double paramArray[2];
            paramArray[0]=  timeIntervalInSeconds;
            paramArray[1]= (double) sCache->mHeader;

            /*iterate round wTable and update stats for each symbol*/
            wtable_for_each (sCache->mSymbolTable,
                             processWTableData, paramArray);
        }
        else
        {    
            /*calculate overall stats for subsCacheriptions*/
            if(sCache->mPData)
            {
                calcPerfData(sCache->mPData,timeIntervalInSeconds,myPerformanceData);
                if(!myPerformanceData)
                {  
                    /* Print out stats */
                    printPerfData (sCache->mPData,sCache->mHeader);	
                }
                resetPeriodCounters(sCache->mPData);
            }
        }
        sCache->mNumMessages=0;
        sCache->mNumBytes=0;
    }
}