Profiler Class Reference

The armarx::Profiler::Profiler class can be used for timing executions within the ArmarX framework. More...

#include <ArmarXCore/core/services/profiler/Profiler.h>

Public Types

enum  EventType { eFunctionStart = 0, eFunctionReturn, eFunctionBreak, eNumberEventTypes }
 The EventType enum provides symbolic names for the different events which can be logged via armarx::Profiler::Profiler::logEvent() More...
 
using EventTypeMap = std::map< Profiler::EventType, std::string >
 

Public Member Functions

void logEvent (Profiler::EventType eventType, const std::string &parentName, const std::string &functionName)
 
void logProcessCpuUsage (float cpuUsage)
 
void logProcessMemoryUsage (int memoryUsage)
 
void logStatechartInputParameters (const std::string &stateIdentifier, const armarx::StateParameterMap &inputParameterMap)
 
void logStatechartLocalParameters (const std::string &stateIdentifier, const armarx::StateParameterMap &localParameterMap)
 
void logStatechartOutputParameters (const std::string &stateIdentifier, const armarx::StateParameterMap &outputParameterMap)
 
void logStatechartTransition (const std::string &parentStateIdentifier, const StateIceBasePtr &sourceState, const StateIceBasePtr &destinationState, const std::string &eventName)
 
void logStatechartTransitionWithParameters (const TransitionIceBase &transition)
 
 Profiler ()
 
void reset ()
 reset reinitializes armarx::Profiler::Profiler::startTime with the current time. More...
 
void setLoggingStrategy (LoggingStrategyPtr loggingStrategy)
 
void setName (const std::string &profilerName)
 
 ~Profiler ()
 

Static Public Member Functions

static std::string GetEventName (Profiler::EventType eventType)
 getEventName maps enum values from armarx::Profiler::Profiler::EventType to strings More...
 

Protected Attributes

std::string profilerName
 

Detailed Description

The armarx::Profiler::Profiler class can be used for timing executions within the ArmarX framework.

The armarx::Profiler::Profiler class provides methods for logging events and statechart transitions. Changing the logging behavior requires calling armarx::Profiler::Profiler::setLoggingStrategy() with a specialized implementation of armarx::Profiler::LoggingStrategy. By default, all calls to log functions are ignored.

Definition at line 88 of file Profiler.h.

Member Typedef Documentation

◆ EventTypeMap

using EventTypeMap = std::map<Profiler::EventType, std::string>

Definition at line 102 of file Profiler.h.

Member Enumeration Documentation

◆ EventType

enum EventType

The EventType enum provides symbolic names for the different events which can be logged via armarx::Profiler::Profiler::logEvent()

Enumerator
eFunctionStart 
eFunctionReturn 
eFunctionBreak 
eNumberEventTypes 

Definition at line 94 of file Profiler.h.

Constructor & Destructor Documentation

◆ Profiler()

Profiler ( )

Definition at line 38 of file Profiler.cpp.

◆ ~Profiler()

~Profiler ( )

Definition at line 45 of file Profiler.cpp.

Member Function Documentation

◆ GetEventName()

std::string GetEventName ( Profiler::EventType  eventType)
static

getEventName maps enum values from armarx::Profiler::Profiler::EventType to strings

Parameters
eventType
Returns
string representation of the enum value

Definition at line 31 of file Profiler.cpp.

+ Here is the caller graph for this function:

◆ logEvent()

void logEvent ( Profiler::EventType  eventType,
const std::string &  parentName,
const std::string &  functionName 
)

Definition at line 70 of file Profiler.cpp.

◆ logProcessCpuUsage()

void logProcessCpuUsage ( float  cpuUsage)

Definition at line 111 of file Profiler.cpp.

◆ logProcessMemoryUsage()

void logProcessMemoryUsage ( int  memoryUsage)

Definition at line 117 of file Profiler.cpp.

◆ logStatechartInputParameters()

void logStatechartInputParameters ( const std::string &  stateIdentifier,
const armarx::StateParameterMap &  inputParameterMap 
)

Definition at line 93 of file Profiler.cpp.

◆ logStatechartLocalParameters()

void logStatechartLocalParameters ( const std::string &  stateIdentifier,
const armarx::StateParameterMap &  localParameterMap 
)

Definition at line 99 of file Profiler.cpp.

◆ logStatechartOutputParameters()

void logStatechartOutputParameters ( const std::string &  stateIdentifier,
const armarx::StateParameterMap &  outputParameterMap 
)

Definition at line 105 of file Profiler.cpp.

◆ logStatechartTransition()

void logStatechartTransition ( const std::string &  parentStateIdentifier,
const StateIceBasePtr &  sourceState,
const StateIceBasePtr &  destinationState,
const std::string &  eventName 
)

Definition at line 77 of file Profiler.cpp.

◆ logStatechartTransitionWithParameters()

void logStatechartTransitionWithParameters ( const TransitionIceBase &  transition)

Definition at line 135 of file Profiler.cpp.

◆ reset()

void reset ( )
inline

reset reinitializes armarx::Profiler::Profiler::startTime with the current time.

◆ setLoggingStrategy()

void setLoggingStrategy ( LoggingStrategyPtr  loggingStrategy)

Definition at line 57 of file Profiler.cpp.

◆ setName()

void setName ( const std::string &  profilerName)

Definition at line 50 of file Profiler.cpp.

Member Data Documentation

◆ profilerName

std::string profilerName
protected

Definition at line 133 of file Profiler.h.


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