NeoPZ
Public Member Functions | Private Attributes | List of all members
RunStatsRecorder Class Reference

#include <stats_recorder.h>

Public Member Functions

 RunStatsRecorder ()
 
 ~RunStatsRecorder ()
 
void start ()
 
void stop ()
 
void lap ()
 
void print (ostream &os) const
 
int append_to (CSVStringTable &st) const
 
int update_row (CSVStringTable &st, unsigned row) const
 
void clear ()
 

Private Attributes

vector< RunStat * > stat_items
 
unsigned n_laps
 

Detailed Description

Class to record execution statistics. For performance reasons it should be declared globally in order to ensure it is only constructed and destructed once.

Definition at line 715 of file stats_recorder.h.

Constructor & Destructor Documentation

◆ RunStatsRecorder()

RunStatsRecorder::RunStatsRecorder ( )
inline

Constructor. Create the RunStat items that should be measured.

Definition at line 720 of file stats_recorder.h.

◆ ~RunStatsRecorder()

RunStatsRecorder::~RunStatsRecorder ( )
inline

Destructor.

vector::clear Removes all elements from the vector (which are destroyed), leaving the container with a size of 0.

Definition at line 739 of file stats_recorder.h.

Member Function Documentation

◆ append_to()

int RunStatsRecorder::append_to ( CSVStringTable st) const
inline

Append metrics to the statistics table. The idea is to keep one table for each segment of code. New runs are appended to the table. Returns: the new_row number if Ok the setCell error code (< 0) if Error.

Definition at line 785 of file stats_recorder.h.

References CSVTable< Tvar >::addRows().

◆ clear()

void RunStatsRecorder::clear ( )
inline

Definition at line 815 of file stats_recorder.h.

◆ lap()

void RunStatsRecorder::lap ( )
inline

Stops the current measurement and starts a new one.

Definition at line 768 of file stats_recorder.h.

◆ print()

void RunStatsRecorder::print ( ostream &  os) const
inline

Prints the statistics

Definition at line 771 of file stats_recorder.h.

◆ start()

void RunStatsRecorder::start ( )
inline

Starts recording the execution statistics.

Definition at line 751 of file stats_recorder.h.

◆ stop()

void RunStatsRecorder::stop ( )
inline

Stops recording the execution statistics.

Definition at line 759 of file stats_recorder.h.

◆ update_row()

int RunStatsRecorder::update_row ( CSVStringTable st,
unsigned  row 
) const
inline

Update a row at the statistics table. Returns: 0 if Ok the setCell error code (< 0) if Error.

Definition at line 801 of file stats_recorder.h.

Member Data Documentation

◆ n_laps

unsigned RunStatsRecorder::n_laps
private

Definition at line 828 of file stats_recorder.h.

◆ stat_items

vector<RunStat*> RunStatsRecorder::stat_items
private

Array of statistics items.

Definition at line 826 of file stats_recorder.h.


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