LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
BenchmarkListener Class Reference

BenchmarkListener class Simple event/run listener getting memory/proc statistics on callback. More...

+ Inheritance diagram for BenchmarkListener:

Public Member Functions

 BenchmarkListener (const BenchmarkListener &)=delete
 
BenchmarkListeneroperator= (const BenchmarkListener &)=delete
 
 BenchmarkListener (const std::string &fname)
 Constructor. More...
 
 ~BenchmarkListener ()
 Destructor. More...
 
void processEvent (EVENT::LCEvent *evt)
 Extract and fill benchmark variables. More...
 
void getVariables (EVENT::LCEvent *event)
 Extract benchmark variables. More...
 
void write ()
 Write benchmarks to ROOT file. More...
 
- Public Member Functions inherited from IO::LCEventListener
virtual ~LCEventListener ()
 Destructor. More...
 
- Public Member Functions inherited from IO::LCRunListener
virtual ~LCRunListener ()
 Destructor. More...
 

Private Member Functions

void modifyEvent (EVENT::LCEvent *)
 Call back for updating an LCEvent. More...
 
void processRunHeader (EVENT::LCRunHeader *)
 Call back for processing an LCRunHeader. More...
 
void modifyRunHeader (EVENT::LCRunHeader *)
 Call back for modifying an existing LCRunHeader. More...
 

Private Attributes

std::shared_ptr< TFile > m_pTFile {nullptr}
 Output root file with benchmarking info. More...
 
TTree * m_pTTree {nullptr}
 Output ROOT tree. More...
 
IO::LCWriterm_lcWriter {nullptr}
 LCIO output file writer. More...
 
std::stringstream m_lcioOutputFileName {}
 The LCIO output file name. More...
 
Float_t m_readTime {0}
 Event reading time. More...
 
clock_t m_firstClock {0}
 The first clock measurement on instance creation. More...
 
clock_t m_lastClock {0}
 The last clock measurement on processEvent() More...
 
Long_t m_residentMemoryReference {0}
 The resident set size on instance creation (reference) More...
 
Long_t m_readResidentMemory {0}
 The resident set size after reading an event (minus reference) More...
 
Int_t m_entry {0}
 The current entry id while filling the tree (for easy plotting) More...
 
Float_t m_writeTime {0}
 The event write time. More...
 
Long_t m_writeRSS {0}
 The resisdent set size after writing. More...
 
Long_t m_procRSS {0}
 The process resident set size taken in processEvent callback. More...
 

Detailed Description

BenchmarkListener class Simple event/run listener getting memory/proc statistics on callback.

Definition at line 24 of file lcio_io_benchmark.cc.

Constructor & Destructor Documentation

BenchmarkListener::BenchmarkListener ( const BenchmarkListener )
delete
BenchmarkListener::BenchmarkListener ( const std::string fname)
inline

Constructor.

Parameters
fnamethe ROOT output file with statistics

Definition at line 34 of file lcio_io_benchmark.cc.

References std::string::c_str(), std::clock(), and std::endl().

BenchmarkListener::~BenchmarkListener ( )
inline

Destructor.

Definition at line 63 of file lcio_io_benchmark.cc.

References std::endl().

Member Function Documentation

void BenchmarkListener::getVariables ( EVENT::LCEvent event)
inline

Extract benchmark variables.

Parameters
eventthe event to process

Definition at line 86 of file lcio_io_benchmark.cc.

References std::clock().

void BenchmarkListener::modifyEvent ( EVENT::LCEvent evt)
inlineprivatevirtual

Call back for updating an LCEvent.

Here all modifications are allowed. Only use this method if you need to remove a collection from the event or you need to modify (fix) exisiting data.

Implements IO::LCEventListener.

Definition at line 118 of file lcio_io_benchmark.cc.

void BenchmarkListener::modifyRunHeader ( EVENT::LCRunHeader rh)
inlineprivatevirtual

Call back for modifying an existing LCRunHeader.

Implements IO::LCRunListener.

Definition at line 120 of file lcio_io_benchmark.cc.

BenchmarkListener& BenchmarkListener::operator= ( const BenchmarkListener )
delete
void BenchmarkListener::processEvent ( EVENT::LCEvent evt)
inlinevirtual

Extract and fill benchmark variables.

Parameters
evtthe event to process

Implements IO::LCEventListener.

Definition at line 76 of file lcio_io_benchmark.cc.

void BenchmarkListener::processRunHeader ( EVENT::LCRunHeader rh)
inlineprivatevirtual

Call back for processing an LCRunHeader.

Access is 'read only'.

Implements IO::LCRunListener.

Definition at line 119 of file lcio_io_benchmark.cc.

void BenchmarkListener::write ( )
inline

Write benchmarks to ROOT file.

Definition at line 110 of file lcio_io_benchmark.cc.

Referenced by main().

Member Data Documentation

Int_t BenchmarkListener::m_entry {0}
private

The current entry id while filling the tree (for easy plotting)

Definition at line 142 of file lcio_io_benchmark.cc.

clock_t BenchmarkListener::m_firstClock {0}
private

The first clock measurement on instance creation.

Definition at line 134 of file lcio_io_benchmark.cc.

clock_t BenchmarkListener::m_lastClock {0}
private

The last clock measurement on processEvent()

Definition at line 136 of file lcio_io_benchmark.cc.

std::stringstream BenchmarkListener::m_lcioOutputFileName {}
private

The LCIO output file name.

Definition at line 130 of file lcio_io_benchmark.cc.

IO::LCWriter* BenchmarkListener::m_lcWriter {nullptr}
private

LCIO output file writer.

Definition at line 128 of file lcio_io_benchmark.cc.

Long_t BenchmarkListener::m_procRSS {0}
private

The process resident set size taken in processEvent callback.

Definition at line 148 of file lcio_io_benchmark.cc.

std::shared_ptr<TFile> BenchmarkListener::m_pTFile {nullptr}
private

Output root file with benchmarking info.

Definition at line 124 of file lcio_io_benchmark.cc.

TTree* BenchmarkListener::m_pTTree {nullptr}
private

Output ROOT tree.

Definition at line 126 of file lcio_io_benchmark.cc.

Long_t BenchmarkListener::m_readResidentMemory {0}
private

The resident set size after reading an event (minus reference)

Definition at line 140 of file lcio_io_benchmark.cc.

Float_t BenchmarkListener::m_readTime {0}
private

Event reading time.

Definition at line 132 of file lcio_io_benchmark.cc.

Long_t BenchmarkListener::m_residentMemoryReference {0}
private

The resident set size on instance creation (reference)

Definition at line 138 of file lcio_io_benchmark.cc.

Long_t BenchmarkListener::m_writeRSS {0}
private

The resisdent set size after writing.

Definition at line 146 of file lcio_io_benchmark.cc.

Float_t BenchmarkListener::m_writeTime {0}
private

The event write time.

Definition at line 144 of file lcio_io_benchmark.cc.


The documentation for this class was generated from the following file: