11#include <framework/utilities/CalcMeanCov.h>
58 m_stats[type].add(time, memory);
84 return m_stats[type].getEntries();
90 return m_stats[type].getSum<0>();
95 return m_stats[type].getMean<0>();
100 return m_stats[type].getStddev<0>();
105 return m_stats[type].getSum<1>();
110 return m_stats[type].getMean<1>();
115 return m_stats[type].getStddev<1>();
121 return m_stats[type].getCorrelation<0, 1>();
127 void csv(std::ostream& output)
const;
137 for (
auto& stat :
m_stats) stat.clear();
Class to calculate mean and and covariance between a number of parameters on running data without sto...
value_type getTimeStddev(EStatisticCounters type=c_Total) const
return the stddev of the execution times for a given counter
value_type getCalls(EStatisticCounters type=c_Total) const
return the number of calls for a given counter type
value_type getTimeMemoryCorrelation(EStatisticCounters type=c_Total) const
return the pearson correlation coefficient between execution times and memory consumption changes
int getIndex() const
Return the index.
value_type getMemoryStddev(EStatisticCounters type=c_Total) const
return the stddev of the memory consumption changes per call
const std::string & getName() const
Return the previously set name.
bool operator==(const ModuleStatistics &other) const
Check if name is identical.
void setIndex(int index)
Set the index of the module when displaying statistics.
void csv(std::ostream &output) const
write data to the given stream in csv format
ModuleStatistics(const std::string &name="")
Construct with a given name.
void add(EStatisticCounters type, value_type time, value_type memory)
Add a time and memory measurement to the counter of a given type.
value_type getMemoryMean(EStatisticCounters type=c_Total) const
return the average memory change per call
void setName(const std::string &name)
Set the name of the module for display.
EStatisticCounters
Enum to define all counter types.
@ c_Init
Counting time/calls in initialize()
@ c_EndRun
Counting time/calls in endRun()
@ c_Term
Counting time/calls in terminate()
@ c_BeginRun
Counting time/calls in beginRun()
@ c_Event
Counting time/calls in event()
@ c_Total
Sum of the above.
value_type getMemorySum(EStatisticCounters type=c_Total) const
return the total used memory for a given counter
value_type getTimeSum(EStatisticCounters type=c_Total) const
return the sum of all execution times for a given counter
value_type getTimeMean(EStatisticCounters type=c_Total) const
return the mean execution time for a given counter
double value_type
type of float variable to use for calculations and storage
bool operator!=(const ModuleStatistics &other) const
inequality.
void clear()
Clear all statistics.
CalcMeanCov< 2, value_type > m_stats[c_Total+1]
array with mean/covariance for all counters
int m_index
display index of the module
void update(const ModuleStatistics &other)
Add statistics for each category.
void csv_header(std::ostream &output) const
write csv header to the given stream
std::string m_name
name of module
Abstract base class for different kinds of events.