// $Id: IDbiTimer.hxx,v 1.1 2011/01/18 05:49:20 finch Exp $
#ifndef DBITIMER
#define DBITIMER
////////////////////////////////////////////////////////////////////////
/// \class COMET::IDbiTimer
///
///
/// \brief Concept: Simple timer, record query progress and final times.
///
/// Purpose: To find out why this is all soooo sssllloooowwww!
///
////////////////////////////////////////////////////////////////////////
#include
#include "TStopwatch.h"
#include "IDbiFieldType.hxx"
namespace COMET {
class IDbiTableMetaData;
}
namespace COMET {
class IDbiTimer
{
public:
// Constructors and destructors.
IDbiTimer();
virtual ~IDbiTimer();
// State testing member functions
// State changing member functions
void RecBegin(string tableName, UInt_t rowSize);
void RecEnd(UInt_t numRows);
void RecFillAgg(Int_t aggNo);
void RecMainQuery();
void Resume();
void StartSubWatch(UInt_t subWatch);
void Suspend();
// Global timer used for all queries to the DBI.
private:
enum QueryStage { kPassive, kInitialQuery, kMainQuery };
enum { kMaxSubWatch = 4 }; // Must be > 0.
// Data members
Int_t fCurSubWatch; // Current SubWatch or -1 if disabled.
UInt_t fRowSize; // Size of row object
QueryStage fQueryStage; // Query stage
TStopwatch fSubWatches[kMaxSubWatch]; // Partial timers
string fTableName; // Current table
TStopwatch fWatch; // Timer
ClassDef(IDbiTimer,0) // Simple query timer
};
};
#endif // DBITIMER