#include <DbiTimerManager.h>
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 | |
| DbiTimerManager | gTimerManager |
Private Member Functions | |
| DbiTimer * | GetCurrent () |
| DbiTimer * | Pop () |
| DbiTimer * | Push () |
Private Attributes | |
| Bool_t | fEnabled |
| Bool_t | fSubWatchEnabled |
| list< DbiTimer * > | fTimers |
|
|
Definition at line 37 of file DbiTimerManager.cxx. 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 }
|
|
|
Definition at line 55 of file DbiTimerManager.cxx. References GetCurrent(), LEA_DTOR, MSG, and Pop(). 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 }
|
|
||||||||||||
|
Definition at line 40 of file DbiTimerManager.h. Referenced by main(), and DbmModule::SetTimer(). 00041 { fEnabled = flag;
00042 fSubWatchEnabled = enableSubWatch;}
|
|
|
Definition at line 72 of file DbiTimerManager.cxx. References fTimers. Referenced by Pop(), Push(), RecEnd(), RecMainQuery(), StartSubWatch(), and ~DbiTimerManager(). 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 }
|
|
|
Definition at line 85 of file DbiTimerManager.cxx. References fTimers, GetCurrent(), DbiTimer::Resume(), and timer(). Referenced by RecEnd(), and ~DbiTimerManager(). 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 }
|
|
|
Definition at line 107 of file DbiTimerManager.cxx. References fTimers, GetCurrent(), DbiTimer::Suspend(), 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 }
|
|
||||||||||||
|
Definition at line 124 of file DbiTimerManager.cxx. References Push(), DbiTimer::RecBegin(), 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 }
|
|
|
Definition at line 143 of file DbiTimerManager.cxx. References GetCurrent(), Pop(), DbiTimer::RecEnd(), 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 }
|
|
|
Definition at line 165 of file DbiTimerManager.cxx. 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 }
|
|
|
Definition at line 183 of file DbiTimerManager.cxx. References GetCurrent(), DbiTimer::RecMainQuery(), 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 }
|
|
|
Definition at line 198 of file DbiTimerManager.cxx. References GetCurrent(), DbiTimer::StartSubWatch(), 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 }
|
|
|
Definition at line 61 of file DbiTimerManager.h. |
|
|
Definition at line 62 of file DbiTimerManager.h. |
|
|
Definition at line 64 of file DbiTimerManager.h. Referenced by GetCurrent(), Pop(), and Push(). |
|
|
Definition at line 30 of file DbiTimerManager.cxx. |
1.3.9.1