 |
Belle II Software
release-05-02-19
|
13 #include <framework/core/ModuleStatistics.h>
14 #include <framework/pcore/Mergeable.h>
15 #include <framework/core/Module.h>
86 class ProcessStatistics :
public Mergeable {
103 const std::vector<Belle2::ModuleStatistics>* modules =
nullptr)
const;
109 const std::vector<Belle2::ModuleStatistics>&
getAll()
const {
return m_stats; }
173 virtual void merge(
const Mergeable* other)
override;
176 virtual void clear()
override;
179 virtual TObject*
Clone(
const char* newname =
"")
const override;
204 double startTime = 0,
double startMemory = 0);
207 std::vector<Belle2::ModuleStatistics>
m_stats;
double m_globalTime
store clock counter for global time consumption
const std::vector< Belle2::ModuleStatistics > & getAll() const
Get entire statistics map.
void resumeGlobal()
Resume timer after call to suspendGlobal()
ClassDefOverride(ProcessStatistics, 2)
(transient)
@ c_Event
Counting time/calls in event()
void suspendGlobal()
Suspend timer for global measurement, needed for newRun.
std::string getStatisticsString(ModuleStatistics::EStatisticCounters type=ModuleStatistics::c_Event, const std::vector< Belle2::ModuleStatistics > *modules=nullptr) const
Return string with statistics for all modules.
EStatisticCounters
Enum to define all counter types.
void appendUnmergedModules(const ProcessStatistics *otherObject)
Merge dissimilar objects (mainly loading ProcessStatistics from file).
void stopModule(const Module *module, ModuleStatistics::EStatisticCounters type)
Stop module counter and attribute values to appropriate module.
double m_globalMemory
(transient)
double m_moduleMemory
(transient)
std::vector< Belle2::ModuleStatistics > m_stats
module statistics
virtual TObject * Clone(const char *newname="") const override
Reimplement TObject::Clone() since we also need m_modulesToStatsIndex.
void setTransientCounters(const ProcessStatistics *otherObject)
Set transient counters from otherObject.
void setCounters(double &time, double &memory, double startTime=0, double startMemory=0)
Set counters time and memory to contain the current clock value and memory consumption respectively.
double m_suspendedMemory
(transient)
void startGlobal()
Start timer for global measurement.
Abstract base class for different kinds of events.
void startModule()
Start module timer.
std::map< const Module *, int > m_modulesToStatsIndex
transient, maps Module* to m_stats index.
ProcessStatistics()
Constructor.
void add(EStatisticCounters type, value_type time, value_type memory)
Add a time and memory measurment to the counter of a given type.
ModuleStatistics & getStatistics(const Module *module)
Get statistics for single module.
void stopGlobal(ModuleStatistics::EStatisticCounters type)
Stop global timer and add values to the statistic counter.
void initModule(const Module *module)
Init module statistics: Set name from module if still empty and remember initialization index for dis...
ProcessStatistics & operator=(ProcessStatistics &)
Prohibit assignment operator.
std::string getInfoHTML() const
Return a short summary of this object's contents in HTML format.
int getIndex(const Module *module)
get m_stats index for given module, inserting it if not found.
double m_suspendedTime
(transient)
Class to collect call statistics for all modules.
@ c_DontCollectStatistics
No statistics is collected for this module.
virtual void clear() override
Clear collected statistics but keep names of modules.
ModuleStatistics m_global
Statistics object for global time and memory consumption.
double m_moduleTime
(transient)
const ModuleStatistics & getGlobal() const
Get global statistics.
virtual void merge(const Mergeable *other) override
Merge other ProcessStatistics object into this one.
Keep track of time and memory consumption during processing.