11#include <framework/core/Module.h>
61 virtual void event()
override;
129 void storeMemoryGraph(
const std::string& name,
const std::string& title,
const std::string& xAxisName,
const std::string& imgOutput,
A module that measures the execution time and memory usage per event.
const MemoryExtractLambda m_extractVirtualMem
Lambda expression to return the virtual memory from a MemTime data structure.
MemTime m_startInfo
memory usage and time at start of event loop + burn in
static const int k_maxPoints
maximal number of profile points
static const int k_burnIn
number of events before the average time measurement is started
virtual void initialize() override
Initializes the Module.
MemTime m_endInfo
memory usage and time at end of event loop
virtual void event() override
Event profiling.
std::function< unsigned long(MemTime const &) > MemoryExtractLambda
Signature of the lambda functions, which are used to extract the memory usage from teh MemTime struct...
virtual void terminate() override
Terminate the Module.
int m_step
number of events between profile points
std::vector< MemTime > m_eventInfo
memory usage and time at individual events
const MemoryExtractLambda m_extractRssMem
Lambda expression to return the Rss memory from a MemTime data structure.
MemTime m_terminateInfo
memory usage and time at termination
ProfileModule()
Constructor.
void storeMemoryGraph(const std::string &name, const std::string &title, const std::string &xAxisName, const std::string &imgOutput, const MemoryExtractLambda &lmdMemoryExtract)
Stores the memory usage of the application over time in plots.
std::string m_rssOutputFileName
Name for rss image output file.
double m_timeOffset
time at module creation
MemTime m_initializeInfo
memory usage and time at initialization
std::string m_outputFileName
Name for image output file.
int m_nEvents
event counter
Abstract base class for different kinds of events.
An internal struct to store pairs of memory usage and time.
MemTime(unsigned long vm=0, unsigned long rssm=0, double t=0)
Constructor with initialization of memory usage and time to zero.
unsigned long virtualMem
virtual memory usage
double time
execution time
unsigned long rssMem
rss memory usage