MeVisLab Toolbox Reference
MLMetaProfile Class Reference

#include <mlMetaProfile.h>

Public Types

enum  MLProfilingFunctionType {
  MLCall = 0 , PythonCall = 1 , FieldNotificationCall = 2 , CppCall = 3 ,
  GLRenderCall = 4 , PythonQtCall = 5 , MLWEMCall = 6 , MDLCommandCall = 7 ,
  MainFunctionCall = 8 , CallTypeCount = 9
}
 

Public Member Functions

const std::vector< MLMetaProfile * > & getSubMetaProfiles () const
 Returns the sub meta profiles. More...
 
void addSubMetaProfile (MLMetaProfile *subMetaProfile)
 Adds a sub meta profile. More...
 
MLCountProfilecreateCountProfile (const std::string &key)
 Creates a count profile. More...
 
MLCountProfilegetCountProfile (const std::string &key) const
 Returns a count profile, or NULL if it does not exist. More...
 
bool incrementCountValue (const std::string &key)
 Increments the count profile value by 1. More...
 
MLProfilingCountType getCountValue (const std::string &key, bool *ok=nullptr) const
 Returns the current value of a count profile. More...
 
const MLCountProfileMapgetCountProfileMap () const
 Returns the map which contains count profiles by functions. More...
 
void setCountProfileDescription (const std::string &key, const std::string &description)
 Sets the description of the count profile. More...
 
MLMemoryProfilecreateMemoryProfile (const std::string &key, MLCurrentlyUsedMemoryTracker *tracker)
 Creates a memory profile. More...
 
MLMemoryProfilegetMemoryProfile (const std::string &key) const
 Returns a memory profile, or NULL if it does not exist. More...
 
bool addMemory (const std::string &key, MLProfilingMemoryType memory)
 Adds allocated memory to a memory profile. More...
 
MLProfilingMemoryType getMemory (const std::string &key, bool *ok=nullptr) const
 Returns the overall used memory in bytes of a memory profile. More...
 
MLProfilingMemoryType getAllMemory () const
 Returns the sum of the overall used memory of all memory profiles. More...
 
MLProfilingMemoryType getCurrentlyUsedMemory (const std::string &key, bool *ok=nullptr) const
 Returns the currently used memory in bytes of a memory profile. More...
 
MLProfilingMemoryType getAllCurrentlyUsedMemory () const
 Returns the sum of the currently used memory of all memory profiles. More...
 
const MLMemoryProfileMapgetMemoryProfileMap () const
 Returns the map which contains memory profiles by functions. More...
 
void setMemoryProfileDescription (const std::string &key, const std::string &description)
 Sets the description of the memory profile. More...
 
MLTimeProfileHandle startMeasuring (const std::string &function, int userId, void *userData=nullptr, const std::string &filename="", int linenumber=-1, const std::string &nodeInfo="")
 Starts measuring time. More...
 
void stopMeasuring (MLTimeProfileHandle &handle, bool ignoreIfEmpty=false)
 Stops measuring time and associates the elapsed time. More...
 
MLTimeProfilegetTimeProfile () const
 Returns the time profile. More...
 
void setDescription (const std::string &description_)
 Sets the meta profile's description. More...
 
const std::string & description () const
 Returns the meta profile's description. More...
 
 ~MLMetaProfile ()
 

Static Public Member Functions

static const char * functionTypeToString (MLProfilingFunctionType type)
 

Friends

class MLMetaProfilePtr
 
class MLProfilingManager
 

Detailed Description

Definition at line 35 of file mlMetaProfile.h.

Member Enumeration Documentation

◆ MLProfilingFunctionType

Enumerator
MLCall 
PythonCall 
FieldNotificationCall 
CppCall 
GLRenderCall 
PythonQtCall 
MLWEMCall 
MDLCommandCall 
MainFunctionCall 
CallTypeCount 

Definition at line 38 of file mlMetaProfile.h.

Constructor & Destructor Documentation

◆ ~MLMetaProfile()

MLMetaProfile::~MLMetaProfile ( )

Member Function Documentation

◆ addMemory()

bool MLMetaProfile::addMemory ( const std::string &  key,
MLProfilingMemoryType  memory 
)

Adds allocated memory to a memory profile.

Parameters
keyThe key that identifies the memory profile.
memoryThe amount of newly allocated memory.
Returns
Returns true if the memory profile does exist, otherwise false.

◆ addSubMetaProfile()

void MLMetaProfile::addSubMetaProfile ( MLMetaProfile subMetaProfile)
inline

Adds a sub meta profile.

Definition at line 57 of file mlMetaProfile.h.

◆ createCountProfile()

MLCountProfile* MLMetaProfile::createCountProfile ( const std::string &  key)

Creates a count profile.

Parameters
keyThe key that identifies the count profile.
Returns
Returns NULL if either no memory is available, or if a count profile with the given key already exists.

◆ createMemoryProfile()

MLMemoryProfile* MLMetaProfile::createMemoryProfile ( const std::string &  key,
MLCurrentlyUsedMemoryTracker tracker 
)

Creates a memory profile.

Parameters
keyThe key that identifies the memory profile.
trackerThe MLCurrentlyUsedMemoryTracker must be set, which is required to read the currently used amount of memory.
Returns
Returns NULL if either no memory is available, or if a memory profile with the given key already exists.

◆ description()

const std::string& MLMetaProfile::description ( ) const
inline

Returns the meta profile's description.

Definition at line 178 of file mlMetaProfile.h.

◆ functionTypeToString()

static const char* MLMetaProfile::functionTypeToString ( MLProfilingFunctionType  type)
static

◆ getAllCurrentlyUsedMemory()

MLProfilingMemoryType MLMetaProfile::getAllCurrentlyUsedMemory ( ) const

Returns the sum of the currently used memory of all memory profiles.

◆ getAllMemory()

MLProfilingMemoryType MLMetaProfile::getAllMemory ( ) const

Returns the sum of the overall used memory of all memory profiles.

◆ getCountProfile()

MLCountProfile* MLMetaProfile::getCountProfile ( const std::string &  key) const

Returns a count profile, or NULL if it does not exist.

Parameters
keyThe key that identifies the count profile.

◆ getCountProfileMap()

const MLCountProfileMap& MLMetaProfile::getCountProfileMap ( ) const
inline

Returns the map which contains count profiles by functions.

Definition at line 86 of file mlMetaProfile.h.

◆ getCountValue()

MLProfilingCountType MLMetaProfile::getCountValue ( const std::string &  key,
bool *  ok = nullptr 
) const

Returns the current value of a count profile.

Parameters
keyThe key that identifies the count profile.
okIf ok is a valid pointer, then it will be set to false if no count profile with the given key exists.
Returns
Returns the current count profile value, or std::numeric_limits<MLProfilingCountType>::max() if the count profile does not exist.

◆ getCurrentlyUsedMemory()

MLProfilingMemoryType MLMetaProfile::getCurrentlyUsedMemory ( const std::string &  key,
bool *  ok = nullptr 
) const

Returns the currently used memory in bytes of a memory profile.

Parameters
keyThe key that identifies the memory profile.
okIf ok is a valid pointer, then it will be set to false if no memory profile with the given key exists.
Returns
Returns the currently used memory, or std::numeric_limits<MLProfilingMemoryType>::max() if the memory profile does not exist.

◆ getMemory()

MLProfilingMemoryType MLMetaProfile::getMemory ( const std::string &  key,
bool *  ok = nullptr 
) const

Returns the overall used memory in bytes of a memory profile.

Parameters
keyThe key that identifies the memory profile.
okIf ok is a valid pointer, then it will be set to false if no memory profile with the given key exists.
Returns
Returns the added memory since instantiation/last reset, or std::numeric_limits<MLProfilingMemoryType>::max() if the memory profile does not exist.

◆ getMemoryProfile()

MLMemoryProfile* MLMetaProfile::getMemoryProfile ( const std::string &  key) const

Returns a memory profile, or NULL if it does not exist.

Parameters
keyThe key that identifies the memory profile.

◆ getMemoryProfileMap()

const MLMemoryProfileMap& MLMetaProfile::getMemoryProfileMap ( ) const
inline

Returns the map which contains memory profiles by functions.

Definition at line 140 of file mlMetaProfile.h.

◆ getSubMetaProfiles()

const std::vector<MLMetaProfile*>& MLMetaProfile::getSubMetaProfiles ( ) const
inline

Returns the sub meta profiles.

Definition at line 54 of file mlMetaProfile.h.

◆ getTimeProfile()

MLTimeProfile* MLMetaProfile::getTimeProfile ( ) const
inline

Returns the time profile.

Definition at line 171 of file mlMetaProfile.h.

◆ incrementCountValue()

bool MLMetaProfile::incrementCountValue ( const std::string &  key)

Increments the count profile value by 1.

Parameters
keyThe key that identifies the count profile.
Returns
Returns true if the count profile does exist, otherwise false.

◆ setCountProfileDescription()

void MLMetaProfile::setCountProfileDescription ( const std::string &  key,
const std::string &  description 
)

Sets the description of the count profile.

Parameters
keyThe key that identifies the count profile.

◆ setDescription()

void MLMetaProfile::setDescription ( const std::string &  description_)
inline

Sets the meta profile's description.

Definition at line 176 of file mlMetaProfile.h.

◆ setMemoryProfileDescription()

void MLMetaProfile::setMemoryProfileDescription ( const std::string &  key,
const std::string &  description 
)

Sets the description of the memory profile.

Parameters
keyThe key that identifies the memory profile.

◆ startMeasuring()

MLTimeProfileHandle MLMetaProfile::startMeasuring ( const std::string &  function,
int  userId,
void *  userData = nullptr,
const std::string &  filename = "",
int  linenumber = -1,
const std::string &  nodeInfo = "" 
)
inline

Starts measuring time.

Parameters
functionThe function identifies the measurement.
userIdThe user id can be any integer, it is just stored.
userDataOptional data that is stored in the call graph nodes.
Returns
Returns the MLTimeProfileHandle, which is required to stop the measurement.

Definition at line 156 of file mlMetaProfile.h.

Referenced by ml::internal::ProfilingScope::startMeasuring().

◆ stopMeasuring()

void MLMetaProfile::stopMeasuring ( MLTimeProfileHandle handle,
bool  ignoreIfEmpty = false 
)
inline

Stops measuring time and associates the elapsed time.

Parameters
handleThe MLTimeProfileHandle returned by startMeasuring() must be given.

Definition at line 168 of file mlMetaProfile.h.

Friends And Related Function Documentation

◆ MLMetaProfilePtr

friend class MLMetaProfilePtr
friend

Definition at line 200 of file mlMetaProfile.h.

◆ MLProfilingManager

friend class MLProfilingManager
friend

Definition at line 201 of file mlMetaProfile.h.


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