Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
MyGlobalProfiler Struct Reference

Detailed Description

Definition at line 23 of file CTimeLogger.cpp.

Inheritance diagram for MyGlobalProfiler:
Inheritance graph

Public Member Functions

 MyGlobalProfiler ()
 
 ~MyGlobalProfiler ()
 
std::string getStatsAsText (const size_t column_width=80) const
 Dump all stats to a multi-line text string. More...
 
void getStats (std::map< std::string, TCallStats > &out_stats) const
 Returns all the current stats as a map: section_name => stats. More...
 
void dumpAllStats (const size_t column_width=80) const
 Dump all stats through the COutputLogger interface. More...
 
void clear (bool deep_clear=false)
 Resets all stats. More...
 
void enable (bool enabled=true)
 
void disable ()
 
bool isEnabled () const
 
void saveToCSVFile (const std::string &csv_file) const
 Dump all stats to a Comma Separated Values (CSV) file. More...
 
void registerUserMeasure (const char *event_name, const double value)
 
void setName (const std::string &name)
 
void enter (const char *func_name)
 Start of a named section. More...
 
double leave (const char *func_name)
 End of a named section. More...
 
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. More...
 
double getLastTime (const std::string &name) const
 Return the last execution time of the given "section", or 0 if it hasn't ever been called "enter" with that section name. More...
 

Protected Types

typedef mrpt::utils::ts_hash_map< std::string, TCallData, 1, 10 > TDataMap
 

Protected Member Functions

void do_enter (const char *func_name)
 
double do_leave (const char *func_name)
 

Protected Attributes

TDataMap m_data
 

Member Typedef Documentation

◆ TDataMap

Definition at line 66 of file CTimeLogger.h.

Constructor & Destructor Documentation

◆ MyGlobalProfiler()

MyGlobalProfiler::MyGlobalProfiler ( )
inline

Definition at line 25 of file CTimeLogger.cpp.

◆ ~MyGlobalProfiler()

MyGlobalProfiler::~MyGlobalProfiler ( )
inline

Definition at line 26 of file CTimeLogger.cpp.

Member Function Documentation

◆ clear()

void CTimeLogger::clear ( bool  deep_clear = false)
inherited

Resets all stats.

By default (deep_clear=false), all section names are remembered (not freed) so the cost of creating upon the first next call is avoided.

Definition at line 100 of file CTimeLogger.cpp.

References mrpt::utils::CTimeLogger::m_data.

◆ disable()

void mrpt::utils::CTimeLogger::disable ( )
inlineinherited

◆ do_enter()

void CTimeLogger::do_enter ( const char *  func_name)
protectedinherited

Definition at line 213 of file CTimeLogger.cpp.

References mrpt::utils::CTimeLogger::m_data, mrpt::utils::CTimeLogger::m_tictac, mrpt::utils::CTimeLogger::TCallData::n_calls, mrpt::utils::CTimeLogger::TCallData::open_calls, and mrpt::utils::CTicTac::Tac().

Referenced by mrpt::utils::CTimeLogger::enter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_leave()

double CTimeLogger::do_leave ( const char *  func_name)
protectedinherited

◆ dumpAllStats()

void CTimeLogger::dumpAllStats ( const size_t  column_width = 80) const
inherited

Dump all stats through the COutputLogger interface.

See also
getStatsAsText, saveToCVSFile

Definition at line 208 of file CTimeLogger.cpp.

References mrpt::utils::CTimeLogger::getStatsAsText(), and MRPT_LOG_INFO_STREAM.

Referenced by mrpt::utils::CTimeLogger::~CTimeLogger().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enable()

void mrpt::utils::CTimeLogger::enable ( bool  enabled = true)
inlineinherited

◆ enter()

void mrpt::utils::CTimeLogger::enter ( const char *  func_name)
inlineinherited

Start of a named section.

See also
enter

Definition at line 117 of file CTimeLogger.h.

References mrpt::utils::CTimeLogger::do_enter(), and mrpt::utils::CTimeLogger::m_enabled.

Referenced by mrpt::graphslam::optimizers::CLevMarqGSO< GRAPH_T >::_optimizeGraph(), mrpt::bayes::detail::addNewLandmarks(), mrpt::vision::bundle_adj_full(), mrpt::utils::CImage::changeSize(), mrpt::detectors::CFaceDetection::checkIfDiagonalSurface(), mrpt::detectors::CFaceDetection::checkIfDiagonalSurface2(), mrpt::detectors::CFaceDetection::checkIfFacePlaneCov(), mrpt::detectors::CFaceDetection::checkIfFaceRegions(), mrpt::graphslam::deciders::CICPCriteriaERD< GRAPH_T >::checkRegistrationCondition2D(), mrpt::graphslam::deciders::CICPCriteriaERD< GRAPH_T >::checkRegistrationCondition3D(), mrpt::utils::CTimeLoggerEntry::CTimeLoggerEntry(), mrpt::detectors::CFaceDetection::detectObjects_Impl(), mrpt::mrpt::utils::global_profiler_enter(), mrpt::nav::CReactiveNavigationSystem3D::implementSenseObstacles(), mrpt::graphslam::deciders::CICPCriteriaERD< GRAPH_T >::initializeVisuals(), mrpt::opengl::CTexturedObject::loadTextureInOpenGL(), mrpt::graphslam::optimize_graph_spa_levmarq(), mrpt::tfest::se2_l2_robust(), mrpt::nav::CAbstractPTGBasedReactive::STEP8_GenerateLogRecord(), mrpt::graphs::ScalarFactorGraph::updateEstimation(), mrpt::graphslam::deciders::CICPCriteriaNRD< GRAPH_T >::updateState(), and mrpt::graphslam::deciders::CICPCriteriaERD< GRAPH_T >::updateVisuals().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLastTime()

double CTimeLogger::getLastTime ( const std::string name) const
inherited

Return the last execution time of the given "section", or 0 if it hasn't ever been called "enter" with that section name.

Definition at line 288 of file CTimeLogger.cpp.

References mrpt::utils::CTimeLogger::m_data.

Referenced by mrpt::nav::CAbstractPTGBasedReactive::performNavigationStep(), and mrpt::nav::CAbstractPTGBasedReactive::STEP8_GenerateLogRecord().

Here is the caller graph for this function:

◆ getMeanTime()

double CTimeLogger::getMeanTime ( const std::string name) const
inherited

Return the mean execution time of the given "section", or 0 if it hasn't ever been called "enter" with that section name.

Definition at line 280 of file CTimeLogger.cpp.

References mrpt::utils::CTimeLogger::m_data.

◆ getStats()

void CTimeLogger::getStats ( std::map< std::string, TCallStats > &  out_stats) const
inherited

◆ getStatsAsText()

std::string CTimeLogger::getStatsAsText ( const size_t  column_width = 80) const
inherited

◆ isEnabled()

bool mrpt::utils::CTimeLogger::isEnabled ( ) const
inlineinherited

Definition at line 109 of file CTimeLogger.h.

References mrpt::utils::CTimeLogger::m_enabled.

Referenced by mrpt::nav::CAbstractPTGBasedReactive::build_movement_candidate().

Here is the caller graph for this function:

◆ leave()

double mrpt::utils::CTimeLogger::leave ( const char *  func_name)
inlineinherited

End of a named section.

Returns
The ellapsed time, in seconds or 0 if disabled.
See also
enter

Definition at line 123 of file CTimeLogger.h.

References mrpt::utils::CTimeLogger::do_leave(), and mrpt::utils::CTimeLogger::m_enabled.

Referenced by mrpt::graphslam::optimizers::CLevMarqGSO< GRAPH_T >::_optimizeGraph(), mrpt::vision::bundle_adj_full(), mrpt::utils::CImage::changeSize(), mrpt::detectors::CFaceDetection::checkIfDiagonalSurface(), mrpt::detectors::CFaceDetection::checkIfDiagonalSurface2(), mrpt::detectors::CFaceDetection::checkIfFacePlaneCov(), mrpt::detectors::CFaceDetection::checkIfFaceRegions(), mrpt::graphslam::deciders::CICPCriteriaERD< GRAPH_T >::checkRegistrationCondition2D(), mrpt::graphslam::deciders::CICPCriteriaERD< GRAPH_T >::checkRegistrationCondition3D(), mrpt::detectors::CFaceDetection::detectObjects_Impl(), mrpt::mrpt::utils::global_profiler_leave(), mrpt::nav::CReactiveNavigationSystem3D::implementSenseObstacles(), mrpt::graphslam::deciders::CICPCriteriaERD< GRAPH_T >::initializeVisuals(), mrpt::opengl::CTexturedObject::loadTextureInOpenGL(), mrpt::graphslam::optimize_graph_spa_levmarq(), mrpt::tfest::se2_l2_robust(), mrpt::nav::CAbstractPTGBasedReactive::STEP8_GenerateLogRecord(), mrpt::graphs::ScalarFactorGraph::updateEstimation(), mrpt::graphslam::deciders::CICPCriteriaNRD< GRAPH_T >::updateState(), mrpt::graphslam::deciders::CICPCriteriaERD< GRAPH_T >::updateVisuals(), and mrpt::utils::CTimeLoggerEntry::~CTimeLoggerEntry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ registerUserMeasure()

void CTimeLogger::registerUserMeasure ( const char *  event_name,
const double  value 
)
inherited

◆ saveToCSVFile()

void CTimeLogger::saveToCSVFile ( const std::string csv_file) const
inherited

Dump all stats to a Comma Separated Values (CSV) file.

See also
dumpAllStats

Definition at line 192 of file CTimeLogger.cpp.

References mrpt::format(), mrpt::utils::CTimeLogger::m_data, and mrpt::utils::CStream::printf().

Here is the call graph for this function:

◆ setName()

void mrpt::utils::CTimeLogger::setName ( const std::string name)
inlineinherited

Definition at line 115 of file CTimeLogger.h.

References mrpt::utils::CTimeLogger::m_name.

Member Data Documentation

◆ m_data

TDataMap mrpt::utils::CTimeLogger::m_data
protectedinherited



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019