![]() |
Diana Software
|
Simple base class for time profiling a module. More...
Public Member Functions | |
| QModuleTimeProfiling () | |
| ctor initialized internal variables More... | |
| virtual | ~QModuleTimeProfiling () |
| dtor does nothing More... | |
| void | SetTimeProfilingOn (bool val) |
| Set the time profiling on/off. More... | |
| bool | GetTimeProfilingOn () const |
| Check if the time profiling is on. More... | |
| void | ResetTimer () |
| Reset the timer to now. More... | |
| double | GetTimer () const |
| return the time since the last reset More... | |
| virtual void | StartProcessCall () |
| Start of a process call. More... | |
| virtual void | EndProcessCall () |
| End a process call and increment time and calls. More... | |
| unsigned long long | GetProcessCalls () const |
| Return the total number of process calls. More... | |
| double | GetTotalProcessTime () const |
| Return the total processing time. More... | |
| double | GetProcessCallTime () const |
| Return the average time of a single process call. More... | |
| std::string | GetTimeProfileReport (const std::string &prefix="") const |
| Report the time profiling. More... | |
Protected Attributes | |
| bool | fTimeProfilingOn |
| Report the time profiling. More... | |
| unsigned long long int | fProcessCalls |
| NUmber of calls to the process. More... | |
| double | fProcessTime |
| Total time spent running the process. More... | |
Private Attributes | |
| clock_t | fTimerStartTime |
| CLock time of the last timer reset. More... | |
Simple base class for time profiling a module.
This class is inherited by QBaseModules and subcomponents of modules, that wish to be timed.
There are two interfaces, you can either handle the timeprofiling yourself by calling ResetTimer() to start the clock, and later GetTimer() to get the time since the reset. You can then increment the time and calls as you wish. Or you can call StartProcessCall() (equivalent to ResetTimer()) and EndProcessCall() to increment the time and calls automatically.
Definition at line 23 of file QModuleTimeProfiling.hh.
| QModuleTimeProfiling::QModuleTimeProfiling | ( | ) |
ctor initialized internal variables
Definition at line 7 of file QModuleTimeProfiling.cc.
|
inlinevirtual |
dtor does nothing
Definition at line 28 of file QModuleTimeProfiling.hh.
|
virtual |
End a process call and increment time and calls.
Definition at line 26 of file QModuleTimeProfiling.cc.
References fProcessCalls, fProcessTime, and GetTimer().
Referenced by QReaderEventGeneratorFiller::Do(), QNeighboursFiller::Do(), QReaderNeighbour::GetNeighbourInfoBase(), and QReaderNeighbour::GetWantsNeighboursBase().
|
inline |
Return the total number of process calls.
Definition at line 42 of file QModuleTimeProfiling.hh.
References fProcessCalls.
Referenced by GetTimeProfileReport().
| double QModuleTimeProfiling::GetProcessCallTime | ( | ) | const |
Return the average time of a single process call.
Definition at line 31 of file QModuleTimeProfiling.cc.
References fProcessCalls, and fProcessTime.
Referenced by GetTimeProfileReport().
| std::string QModuleTimeProfiling::GetTimeProfileReport | ( | const std::string & | prefix = "" | ) | const |
Report the time profiling.
Definition at line 35 of file QModuleTimeProfiling.cc.
References GetProcessCalls(), and GetProcessCallTime().
Referenced by QReader::End(), and QBaseModule::EndBase().
|
inline |
Check if the time profiling is on.
Definition at line 32 of file QModuleTimeProfiling.hh.
References fTimeProfilingOn.
Referenced by QReader::End(), QBaseModule::EndBase(), and QBaseModule::ProcessBase().
| double QModuleTimeProfiling::GetTimer | ( | ) | const |
return the time since the last reset
Definition at line 18 of file QModuleTimeProfiling.cc.
References fTimerStartTime.
Referenced by EndProcessCall(), and QBaseModule::ProcessBase().
|
inline |
Return the total processing time.
Definition at line 44 of file QModuleTimeProfiling.hh.
References fProcessTime.
| void QModuleTimeProfiling::ResetTimer | ( | ) |
Reset the timer to now.
Definition at line 14 of file QModuleTimeProfiling.cc.
References fTimerStartTime.
Referenced by QBaseModule::ProcessBase(), and StartProcessCall().
|
inline |
Set the time profiling on/off.
Definition at line 30 of file QModuleTimeProfiling.hh.
References fTimeProfilingOn.
Referenced by QBaseModule::BeginBase().
|
virtual |
Start of a process call.
Definition at line 22 of file QModuleTimeProfiling.cc.
References ResetTimer().
Referenced by QReaderEventGeneratorFiller::Do(), QNeighboursFiller::Do(), QReaderNeighbour::GetNeighbourInfoBase(), and QReaderNeighbour::GetWantsNeighboursBase().
|
protected |
NUmber of calls to the process.
Definition at line 55 of file QModuleTimeProfiling.hh.
Referenced by QBaseModule::BeginBase(), QBaseModule::EndBase(), EndProcessCall(), GetProcessCalls(), GetProcessCallTime(), and QBaseModule::ProcessBase().
|
protected |
Total time spent running the process.
Definition at line 57 of file QModuleTimeProfiling.hh.
Referenced by QBaseModule::BeginBase(), EndProcessCall(), GetProcessCallTime(), GetTotalProcessTime(), and QBaseModule::ProcessBase().
|
protected |
Report the time profiling.
Definition at line 53 of file QModuleTimeProfiling.hh.
Referenced by GetTimeProfilingOn(), and SetTimeProfilingOn().
|
private |
CLock time of the last timer reset.
Definition at line 61 of file QModuleTimeProfiling.hh.
Referenced by GetTimer(), and ResetTimer().