Concept: Manager of a set of simple timers. More...
#include <TDbiTimerManager.hxx>
Public Member Functions | |
TDbiTimerManager () | |
virtual | ~TDbiTimerManager () |
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 TDbiTimerManager | gTimerManager |
Private Member Functions | |
TDbiTimer * | GetCurrent () |
TDbiTimer * | Pop () |
TDbiTimer * | Push () |
Private Attributes | |
Bool_t | fEnabled |
Bool_t | fSubWatchEnabled |
list< TDbiTimer * > | fTimers |
Concept: Manager of a set of simple timers.
Purpose: To find out why this is all soooo sssllloooowwww!
Definition at line 24 of file TDbiTimerManager.hxx.
TDbiTimerManager::TDbiTimerManager | ( | ) |
TDbiTimerManager::~TDbiTimerManager | ( | ) | [virtual] |
Definition at line 54 of file TDbiTimerManager.cxx.
References GetCurrent(), Pop(), and SK_DBI_Trace.
00054 { 00055 // 00056 // 00057 // Purpose: Destructor 00058 // 00059 // Contact: N. West 00060 // 00061 00062 00063 SK_DBI_Trace( "Destroying TDbiTimerManager" << " "); 00064 while ( this->GetCurrent() ) this->Pop(); 00065 00066 }
void TDbiTimerManager::Enable | ( | Bool_t | flag = kTRUE , |
|
Bool_t | enableSubWatch = kFALSE | |||
) | [inline] |
Definition at line 36 of file TDbiTimerManager.hxx.
References fEnabled, and fSubWatchEnabled.
00037 { fEnabled = flag; 00038 fSubWatchEnabled = enableSubWatch;}
TDbiTimer * TDbiTimerManager::GetCurrent | ( | ) | [private] |
Definition at line 70 of file TDbiTimerManager.cxx.
References fTimers.
Referenced by Pop(), Push(), RecEnd(), RecMainQuery(), StartSubWatch(), and ~TDbiTimerManager().
00070 { 00071 // 00072 // 00073 // Purpose: Get the current timer if any. 00074 // 00075 // Return: Curent timer or null if none. 00076 // 00077 // Contact: N. West 00078 00079 return fTimers.empty() ? 0 : *(fTimers.begin()); 00080 }
TDbiTimer * TDbiTimerManager::Pop | ( | ) | [private] |
Definition at line 83 of file TDbiTimerManager.cxx.
References fTimers, GetCurrent(), and TDbiTimer::Resume().
Referenced by RecEnd(), and ~TDbiTimerManager().
00083 { 00084 // 00085 // 00086 // Purpose: Remove the most recent timer, and resume the previous. 00087 // 00088 // Return: Previous timer (if any). 00089 // 00090 00091 if ( fTimers.empty() ) return 0; 00092 00093 TDbiTimer* timer = this->GetCurrent(); 00094 delete timer; 00095 timer = 0; 00096 fTimers.pop_front(); 00097 timer = this->GetCurrent(); 00098 if ( timer ) timer->Resume(); 00099 return timer; 00100 00101 }
TDbiTimer * TDbiTimerManager::Push | ( | ) | [private] |
Definition at line 105 of file TDbiTimerManager.cxx.
References fTimers, GetCurrent(), and TDbiTimer::Suspend().
Referenced by RecBegin().
00105 { 00106 // 00107 // 00108 // Purpose: Suspend current time and add new timer to stack. 00109 // 00110 // Return: New timer. 00111 // 00112 00113 TDbiTimer* timer = this->GetCurrent(); 00114 if ( timer ) timer->Suspend(); 00115 fTimers.push_front(new TDbiTimer); 00116 return this->GetCurrent(); 00117 00118 }
void TDbiTimerManager::RecBegin | ( | string | tableName, | |
UInt_t | rowSize | |||
) |
Definition at line 122 of file TDbiTimerManager.cxx.
References fEnabled, Push(), and TDbiTimer::RecBegin().
00122 { 00123 // 00124 // 00125 // Purpose: Record the start of initial query on supplied table. 00126 // 00127 // Arguments: 00128 // tableName in Name of table. 00129 // rowSize in Size of row object 00130 // 00131 // Contact: N. West 00132 00133 // Suspend current timer, if any, and start a new one. 00134 00135 if ( ! fEnabled ) return; 00136 TDbiTimer* timer = this->Push(); 00137 timer->RecBegin(tableName, rowSize); 00138 }
void TDbiTimerManager::RecEnd | ( | UInt_t | numRows | ) |
Definition at line 141 of file TDbiTimerManager.cxx.
References fEnabled, GetCurrent(), Pop(), and TDbiTimer::RecEnd().
00141 { 00142 // 00143 // 00144 // Purpose: Record the end of query. 00145 // 00146 // Arguments: 00147 // numRows in Number of rows found in query 00148 // 00149 // Contact: N. West 00150 00151 if ( ! fEnabled ) return; 00152 00153 // Terminate the current timer and resume the previous one. 00154 00155 TDbiTimer* timer = this->GetCurrent(); 00156 if ( timer ) timer->RecEnd(numRows); 00157 timer = this->Pop(); 00158 00159 }
void TDbiTimerManager::RecFillAgg | ( | Int_t | aggNo | ) |
Definition at line 163 of file TDbiTimerManager.cxx.
References fEnabled.
Referenced by ClassImp().
00163 { 00164 // 00165 // 00166 // Purpose: Record filling of aggregate. 00167 // 00168 // Arguments: 00169 // aggNo in Aggregate number. 00170 // 00171 // Contact: N. West 00172 00173 if ( ! fEnabled ) return; 00174 00175 // Currently a no-op. 00176 00177 }
void TDbiTimerManager::RecMainQuery | ( | ) |
Definition at line 181 of file TDbiTimerManager.cxx.
References fEnabled, GetCurrent(), and TDbiTimer::RecMainQuery().
Referenced by TDbiDBProxy::QuerySeqNo(), TDbiDBProxy::QuerySeqNos(), TDbiTableProxy::RestoreFromL2Cache(), and TDbiTableProxy::SaveToL2Cache().
00181 { 00182 // 00183 // 00184 // Purpose: Record the start of main query. 00185 // 00186 // Contact: N. West 00187 00188 if ( ! fEnabled ) return; 00189 TDbiTimer* timer = this->GetCurrent(); 00190 if ( timer ) timer->RecMainQuery(); 00191 00192 }
void TDbiTimerManager::StartSubWatch | ( | UInt_t | subWatch | ) |
Definition at line 196 of file TDbiTimerManager.cxx.
References fEnabled, GetCurrent(), and TDbiTimer::StartSubWatch().
Referenced by ClassImp().
00196 { 00197 // 00198 // 00199 // Purpose: Start specified SubWatch if SubWatch timers enabled. 00200 // 00201 // Arguments: 00202 // subWatch in SubWatch number ( 0 .. kMaxSubWatch-1 ). 00203 // 00204 // Contact: N. West 00205 00206 if ( ! fEnabled ) return; 00207 TDbiTimer* timer = this->GetCurrent(); 00208 if ( timer ) timer->StartSubWatch(subWatch); 00209 00210 }
Bool_t TDbiTimerManager::fEnabled [private] |
Definition at line 57 of file TDbiTimerManager.hxx.
Referenced by Enable(), RecBegin(), RecEnd(), RecFillAgg(), RecMainQuery(), and StartSubWatch().
Bool_t TDbiTimerManager::fSubWatchEnabled [private] |
Definition at line 58 of file TDbiTimerManager.hxx.
Referenced by Enable().
list<TDbiTimer*> TDbiTimerManager::fTimers [private] |
Definition at line 60 of file TDbiTimerManager.hxx.
Referenced by GetCurrent(), Pop(), and Push().
Definition at line 47 of file TDbiTimerManager.hxx.
Referenced by ClassImp(), TDbiDBProxy::QuerySeqNo(), TDbiDBProxy::QuerySeqNos(), TDbiTableProxy::RestoreFromL2Cache(), and TDbiTableProxy::SaveToL2Cache().