libqi-api  2.8.7.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | List of all members
qi::DataPerfSuite Class Reference

A class to perform benchmarks. More...

#include <dataperfsuite.hpp>

Public Types

enum  OutputData {
  OutputData_None = 0, OutputData_Cpu = 1, OutputData_Period = 2, OutputData_MsgPerSecond = 3,
  OutputData_MsgMBPerSecond = 4
}
 

Public Member Functions

 DataPerfSuite (const std::string &projectName, const std::string &executableName, OutputData outputData=OutputData_None, const std::string &filename="")
 Constructor. More...
 
 ~DataPerfSuite ()
 Destructor. More...
 
DataPerfSuiteoperator<< (const DataPerf &data)
 Overloading used to print data out. More...
 
void close ()
 Print end of file and close it. More...
 
void flush ()
 

Detailed Description

A class to perform benchmarks.

* This class is used to perform benchmarks.
*
* Use:
* .. highlight:: c++
*    :linenothreshold: 1
*    DataPerfSuite DPS("My_project, "My_executable", DataPerfSuite::OutputType_Normal, "data.xml");
*    { // ...
*    }
*    DataPerf DP;
*    { // ...
*    }
*    while (true) {
*      DP.start();
*      { // ...
*      } // What I want to measure.
*      DP.stop();
*      { // ...
*      }
*      DPS << DP;
*    }
* 

Definition at line 22 of file dataperfsuite.hpp.

Member Enumeration Documentation

Enumerator
OutputData_None 
OutputData_Cpu 
OutputData_Period 
OutputData_MsgPerSecond 
OutputData_MsgMBPerSecond 

Definition at line 26 of file dataperfsuite.hpp.

Constructor & Destructor Documentation

qi::DataPerfSuite::DataPerfSuite ( const std::string &  projectName,
const std::string &  executableName,
OutputData  outputData = OutputData_None,
const std::string &  filename = "" 
)

Constructor.

Parameters
projectNamethe name of the project being benchmarked
executableNamethe name of the executable use for benchmarking
outputTypetype of output
filenamefilename where store output. Put an empty string to output on stdout
qi::DataPerfSuite::~DataPerfSuite ( )

Destructor.

Member Function Documentation

qi::DataPerfSuite::close ( )

Print end of file and close it.

void qi::DataPerfSuite::flush ( )
qi::DataPerfSuite::operator<< ( const DataPerf data)

Overloading used to print data out.

Parameters
dataData to print out.
Returns
The actual class. Permit to chain.

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