A versatile "profiler" that logs the time spent within each pair of calls to enter(X)-leave(X), among other stats.
The results can be dumped to cout or to Visual Studio's output panel. Recursive methods are supported with no problems, that is, calling "enter(X) enter(X) ... leave(X) leave(X)".
Definition at line 48 of file CTimeLogger.h.
#include <mrpt/utils/CTimeLogger.h>

Classes | |
| struct | TCallData |
| Data of all the calls: More... | |
Public Member Functions | |
| CTimeLogger (bool enabled=true) | |
| virtual | ~CTimeLogger () |
| Default constructor. | |
| std::string | getStatsAsText (const size_t column_width=80) const |
| Dump all stats to a multi-line text string. | |
| void | dumpAllStats (const size_t column_width=80) const |
| Dump all stats through the CDebugOutputCapable interface. | |
| void | clear () |
| void | enable (bool enabled=true) |
| void | disable () |
| void | saveToCSVFile (const std::string &csv_file) const |
| Dump all stats to a Comma Separated Values (CSV) file. | |
| void | enter (const char *func_name) |
| Start of a named section. | |
| double | leave (const char *func_name) |
| End of a named section. | |
| double | getMeanTime (const std::string &name) const |
| Return the mean execution time of the given "section", or 0 if it hasn't ever been called "enter" with that section name. | |
Static Public Member Functions | |
| static void | printf_debug (const char *frmt,...) |
| Sends a formated text to "debugOut" if not NULL, or to cout otherwise. | |
Private Member Functions | |
| void | do_enter (const char *func_name) |
| double | do_leave (const char *func_name) |
Private Attributes | |
| CTicTac | m_tictac |
| bool | m_enabled |
| map< string, TCallData > | m_data |
| mrpt::utils::CTimeLogger::CTimeLogger | ( | bool | enabled = true | ) |
|
virtual |
Default constructor.
Destructor
| void mrpt::utils::CTimeLogger::clear | ( | ) |
|
inline |
Definition at line 76 of file CTimeLogger.h.
|
private |
|
private |
| void mrpt::utils::CTimeLogger::dumpAllStats | ( | const size_t | column_width = 80 | ) | const |
Dump all stats through the CDebugOutputCapable interface.
|
inline |
Definition at line 75 of file CTimeLogger.h.
|
inline |
Start of a named section.
Definition at line 80 of file CTimeLogger.h.
Referenced by mrpt::bayes::detail::CRunOneKalmanIteration_addNewLandmarks::operator()(), and mrpt::graphslam::optimize_graph_spa_levmarq().
| double mrpt::utils::CTimeLogger::getMeanTime | ( | const std::string & | name | ) | const |
Return the mean execution time of the given "section", or 0 if it hasn't ever been called "enter" with that section name.
| std::string mrpt::utils::CTimeLogger::getStatsAsText | ( | const size_t | column_width = 80 | ) | const |
Dump all stats to a multi-line text string.
|
inline |
End of a named section.
Definition at line 85 of file CTimeLogger.h.
Referenced by mrpt::bayes::detail::CRunOneKalmanIteration_addNewLandmarks::operator()(), and mrpt::graphslam::optimize_graph_spa_levmarq().
|
staticinherited |
Sends a formated text to "debugOut" if not NULL, or to cout otherwise.
Referenced by mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::execute().
| void mrpt::utils::CTimeLogger::saveToCSVFile | ( | const std::string & | csv_file | ) | const |
Dump all stats to a Comma Separated Values (CSV) file.
|
private |
Definition at line 64 of file CTimeLogger.h.
|
private |
Definition at line 52 of file CTimeLogger.h.
|
private |
Definition at line 51 of file CTimeLogger.h.
| Page generated by Doxygen 1.8.3 for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013 |