DbiTimerManager Class Reference

#include <DbiTimerManager.h>

List of all members.

Public Member Functions

 DbiTimerManager ()
virtual ~DbiTimerManager ()
void Enable (Bool_t flag=kTRUE, Bool_t enableSubWatch=kFALSE)
void RecBegin (string tableName, UInt_t rowSize)
void RecEnd (UInt_t numRows)
void RecFillAgg (Int_t aggNo)
void RecMainQuery ()
void StartSubWatch (UInt_t subWatch)

Static Public Attributes

static DbiTimerManager gTimerManager

Private Member Functions

DbiTimerGetCurrent ()
DbiTimerPop ()
DbiTimerPush ()

Private Attributes

Bool_t fEnabled
Bool_t fSubWatchEnabled
list< DbiTimer * > fTimers


Detailed Description

Definition at line 28 of file DbiTimerManager.h.


Constructor & Destructor Documentation

DbiTimerManager::DbiTimerManager (  ) 

Definition at line 37 of file DbiTimerManager.cxx.

References Msg::kVerbose, LEA_CTOR, and MSG.

00037                                  :
00038 fEnabled(kTRUE)
00039 {
00040 //
00041 //
00042 //  Purpose:  Default constructor
00043 //
00044 //  Contact:   N. West
00045 //
00046 
00047   LEA_CTOR    //Leak Checker
00048 
00049   MSG("Dbi", Msg::kVerbose) << "Creating DbiTimerManager" << endl;
00050 
00051 }

DbiTimerManager::~DbiTimerManager (  )  [virtual]

Definition at line 55 of file DbiTimerManager.cxx.

References Msg::kVerbose, LEA_DTOR, and MSG.

00055                                   {
00056 //
00057 //
00058 //  Purpose: Destructor
00059 //
00060 //  Contact:   N. West
00061 //
00062 
00063   LEA_DTOR    //Leak Checker
00064 
00065   MSG("Dbi", Msg::kVerbose) << "Destroying DbiTimerManager" << endl;
00066   while ( this->GetCurrent() ) this->Pop();
00067 
00068 }


Member Function Documentation

void DbiTimerManager::Enable ( Bool_t  flag = kTRUE,
Bool_t  enableSubWatch = kFALSE 
) [inline]

Definition at line 40 of file DbiTimerManager.h.

References fEnabled, and fSubWatchEnabled.

Referenced by main(), and DbmModule::SetTimer().

00041                                                 { fEnabled = flag;
00042                                     fSubWatchEnabled = enableSubWatch;}

DbiTimer * DbiTimerManager::GetCurrent (  )  [private]

Definition at line 72 of file DbiTimerManager.cxx.

References fTimers.

Referenced by Pop(), Push(), RecEnd(), RecMainQuery(), and StartSubWatch().

00072                                       {
00073 //
00074 //
00075 //  Purpose:  Get the current timer if any.
00076 //
00077 //  Return:   Curent timer or null if none.  
00078 //
00079 //  Contact:   N. West
00080 
00081   return fTimers.empty() ? 0 : *(fTimers.begin());
00082 }

DbiTimer * DbiTimerManager::Pop (  )  [private]

Definition at line 85 of file DbiTimerManager.cxx.

References fTimers, GetCurrent(), and timer().

Referenced by RecEnd().

00085                                {
00086 //
00087 //
00088 //  Purpose:   Remove the most recent timer, and resume the previous.
00089 //
00090 //  Return:    Previous timer (if any).
00091 //
00092 
00093   if ( fTimers.empty() ) return 0;
00094 
00095   DbiTimer* timer = this->GetCurrent();
00096   delete timer;
00097   timer = 0;
00098   fTimers.pop_front();
00099   timer = this->GetCurrent();
00100   if ( timer ) timer->Resume();
00101   return timer;
00102 
00103 }

DbiTimer * DbiTimerManager::Push (  )  [private]

Definition at line 107 of file DbiTimerManager.cxx.

References fTimers, GetCurrent(), and timer().

Referenced by RecBegin().

00107                                 {
00108 //
00109 //
00110 //  Purpose:   Suspend current time and add new timer to stack.
00111 //
00112 //  Return:    New timer.
00113 //
00114 
00115   DbiTimer* timer = this->GetCurrent();
00116   if ( timer ) timer->Suspend();
00117   fTimers.push_front(new DbiTimer);
00118   return this->GetCurrent();
00119   
00120 }

void DbiTimerManager::RecBegin ( string  tableName,
UInt_t  rowSize 
)

Definition at line 124 of file DbiTimerManager.cxx.

References fEnabled, Push(), and timer().

Referenced by DbiResultPtr< T >::NewQuery().

00124                                                                {
00125 //
00126 //
00127 //  Purpose:  Record the start of initial query on supplied table.
00128 //
00129 //  Arguments: 
00130 //    tableName    in    Name of table.
00131 //    rowSize      in    Size of row object
00132 //
00133 //  Contact:   N. West
00134 
00135 //  Suspend current timer, if any, and start a new one.
00136 
00137   if ( ! fEnabled ) return;
00138   DbiTimer* timer = this->Push();
00139   timer->RecBegin(tableName, rowSize);  
00140 }

void DbiTimerManager::RecEnd ( UInt_t  numRows  ) 

Definition at line 143 of file DbiTimerManager.cxx.

References fEnabled, GetCurrent(), Pop(), and timer().

Referenced by DbiResultPtr< T >::NewQuery().

00143                                            {
00144 //
00145 //
00146 //  Purpose:  Record the end of query.
00147 //
00148 //  Arguments: 
00149 //    numRows    in    Number of rows found in query
00150 //
00151 //  Contact:   N. West
00152 
00153   if ( ! fEnabled ) return;
00154 
00155 //  Terminate the current timer and resume the previous one.
00156 
00157   DbiTimer* timer = this->GetCurrent();
00158   if ( timer ) timer->RecEnd(numRows);
00159   timer = this->Pop();
00160 
00161 }

void DbiTimerManager::RecFillAgg ( Int_t  aggNo  ) 

Definition at line 165 of file DbiTimerManager.cxx.

References fEnabled.

Referenced by DbiResultNonAgg::DbiResultNonAgg().

00165                                                   {
00166 //
00167 //
00168 //  Purpose:  Record filling of aggregate.
00169 //
00170 //  Arguments: 
00171 //    aggNo        in    Aggregate number.
00172 //
00173 //  Contact:   N. West
00174 
00175   if ( ! fEnabled ) return;
00176 
00177 //  Currently a no-op.
00178 
00179 }

void DbiTimerManager::RecMainQuery (  ) 

Definition at line 183 of file DbiTimerManager.cxx.

References fEnabled, GetCurrent(), and timer().

Referenced by DbiDBProxy::QuerySeqNo(), DbiDBProxy::QuerySeqNos(), DbiTableProxy::RestoreFromL2Cache(), and DbiTableProxy::SaveToL2Cache().

00183                                    {
00184 //
00185 //
00186 //  Purpose:  Record the start of main query.
00187 //
00188 //  Contact:   N. West
00189 
00190   if ( ! fEnabled ) return;
00191   DbiTimer* timer = this->GetCurrent();
00192   if ( timer ) timer->RecMainQuery();
00193 
00194 }

void DbiTimerManager::StartSubWatch ( UInt_t  subWatch  ) 

Definition at line 198 of file DbiTimerManager.cxx.

References fEnabled, GetCurrent(), and timer().

Referenced by DbiResultAgg::DbiResultAgg(), and DbiResultNonAgg::DbiResultNonAgg().

00198                                                    {
00199 //
00200 //
00201 //  Purpose:  Start specified SubWatch if SubWatch timers enabled.
00202 //
00203 //  Arguments: 
00204 //    subWatch     in    SubWatch number ( 0 .. kMaxSubWatch-1 ).
00205 //
00206 //  Contact:   N. West
00207 
00208   if ( ! fEnabled ) return;
00209   DbiTimer* timer = this->GetCurrent();
00210   if ( timer ) timer->StartSubWatch(subWatch);
00211 
00212 }


Member Data Documentation

Bool_t DbiTimerManager::fEnabled [private]

Definition at line 61 of file DbiTimerManager.h.

Referenced by Enable(), RecBegin(), RecEnd(), RecFillAgg(), RecMainQuery(), and StartSubWatch().

Bool_t DbiTimerManager::fSubWatchEnabled [private]

Definition at line 62 of file DbiTimerManager.h.

Referenced by Enable().

list<DbiTimer*> DbiTimerManager::fTimers [private]

Definition at line 64 of file DbiTimerManager.h.

Referenced by GetCurrent(), Pop(), and Push().

DbiTimerManager DbiTimerManager::gTimerManager [static]

Definition at line 51 of file DbiTimerManager.h.

Referenced by DbiResultAgg::DbiResultAgg(), DbiResultNonAgg::DbiResultNonAgg(), main(), DbiResultPtr< T >::NewQuery(), DbiDBProxy::QuerySeqNo(), DbiDBProxy::QuerySeqNos(), DbiTableProxy::RestoreFromL2Cache(), DbiTableProxy::SaveToL2Cache(), and DbmModule::SetTimer().


The documentation for this class was generated from the following files:
Generated on Wed Dec 10 22:49:26 2014 for loon by  doxygen 1.4.7