00001
00002
00003 #ifndef DBITIMER
00004 #define DBITIMER
00005
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00018
00019 #include <string>
00020
00021 #include "TStopwatch.h"
00022 #include "DatabaseInterface/DbiFieldType.h"
00023
00024 class DbiTableMetaData;
00025
00026 class DbiTimer
00027 {
00028
00029 public:
00030
00031
00032 DbiTimer();
00033 virtual ~DbiTimer();
00034
00035
00036
00037
00038 void RecBegin(string tableName, UInt_t rowSize);
00039 void RecEnd(UInt_t numRows);
00040 void RecFillAgg(Int_t aggNo);
00041 void RecMainQuery();
00042 void Resume();
00043 void StartSubWatch(UInt_t subWatch);
00044 void Suspend();
00045
00046
00047
00048 private:
00049
00050 enum QueryStage { kPassive, kInitialQuery, kMainQuery };
00051 enum { kMaxSubWatch = 4 };
00052
00053
00054
00055 Int_t fCurSubWatch;
00056 UInt_t fRowSize;
00057 QueryStage fQueryStage;
00058 TStopwatch fSubWatches[kMaxSubWatch];
00059 string fTableName;
00060 TStopwatch fWatch;
00061
00062 ClassDef(DbiTimer,0)
00063
00064 };
00065
00066
00067 #endif // DBITIMER
00068