/************************************************************************
 * reset the class attribute for a new interval value
************************************************************************/
void
CompilerTrackingInfo::resetIntervalIfNeeded()
{
      Lng32 currentInterval =
           ActiveSchemaDB()->getDefaults().getAsLong(COMPILER_TRACKING_INTERVAL);

      if ((0 == prevInterval_) && (0 < currentInterval))
           resetInterval();           
}
Beispiel #2
0
/************************************************************************
method CompilerTrackingInfo::logCompilerStatusOnInterval

Dump the fields of this class out to a file (or to repository) if
the tracking compiler interval has expired

************************************************************************/
void
CompilerTrackingInfo::logCompilerStatusOnInterval(Int32 intervalLengthMins)
{

  if( intervalExpired(intervalLengthMins) )
  {
    //
    // this interval is now done/expired
    endIntervalTime_ = getCurrentTimestamp();
    //
    // get the latest cache stats once per interval
    if (!CURRENTQCACHE->getCompilationCacheStats(currentQCacheStats_))
    {
       // if query is disabled, clear the cache counters
       clearQCacheCounters();
    }

    //
    // log this interval
    if( NULL != getCompilerTrackingLogFilename() )
    {
      printToFile();      
    }

    //
    // log directly to a private table using dynamic SQL 
    // instead of using the Repository infrastructure to
    // populate repository table
    if (CmpCommon::getDefault(COMPILER_TRACKING_LOGTABLE) == DF_ON)
    {
       logIntervalInPrivateTable();    
    }

//
// This table doesn't exist on Windows, so don't log there
    // always log to the repository table
    Int32 rc = logIntervalInRepository();    
    if (rc)
    {
       // raise a warning that compiler process is unable to log 
       // its status and health information to the repository
       *CmpCommon::diags() << DgSqlCode(2242);
    }

    //
    // since the interval is expired, reset to begin tracking new interval
    resetInterval();        
  }
}
/*---------------------------------------------------------------------------*/
error_t bcpForwardingEngine_stdControlStart() {
	pmesg(200, "%s :: %s :: Line #%d\n", __FILE__, __func__, __LINE__);
	isRunningForwardingEngine = true;

	//Start beaconing - we'll need this anyway =)
	//call BeaconTimer.startPeriodic(BEACON_TIME);
	resetInterval(); 

//NO_SNOOP: initial low power
// #ifdef LOW_POWER_LISTENING
// 	//	call LowPowerListening.setLocalSleepInterval(LPL_SLEEP_INTERVAL_MS); 
// 	call LowPowerListening.setLocalWakeupInterval(LPL_SLEEP_INTERVAL_MS);
// #endif

	return SUCCESS;    
}
/************************************************************************
method CompilerTrackingInfo::logCompilerStatusOnInterval

Dump the fields of this class out to a file (or to repository) if
the tracking compiler interval has expired

************************************************************************/
void
CompilerTrackingInfo::logCompilerStatusOnInterval(Int32 intervalLengthMins)
{

  if( intervalExpired(intervalLengthMins) )
  {
    //
    // this interval is now done/expired
    endIntervalTime_ = getCurrentTimestamp();
    //
    // get the latest cache stats once per interval
    if (!CURRENTQCACHE->getCompilationCacheStats(currentQCacheStats_))
    {
       // if query is disabled, clear the cache counters
       clearQCacheCounters();
    }

    //
    // log this interval
    if( NULL != getCompilerTrackingLogFilename() )
    {
      printToFile();      
    }

    //
    // log directly to a private table using dynamic SQL 
    if (CmpCommon::getDefault(COMPILER_TRACKING_LOGTABLE) == DF_ON)
    {
       logIntervalInPrivateTable();    
    }

    // always log to log4cxx log
    logIntervalInLog4Cxx();
        
    // since the interval is expired, reset to begin tracking new interval
    resetInterval();        
  }
}