Dali 3D User Interface Engine
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
Dali::Internal::Adaptor::StatContextManager Class Reference

Class to manage StatContext objects. More...

#include <stat-context-manager.h>

Collaboration diagram for Dali::Internal::Adaptor::StatContextManager:
Collaboration graph
[legend]

Public Member Functions

 StatContextManager (StatContextLogInterface &logInterface)
 Constructor. More...
 
 ~StatContextManager ()
 destructor, not intended as a bass class More...
 
PerformanceInterface::ContextId AddContext (const char *const name, PerformanceMarker::MarkerFilter type)
 Add a context. More...
 
void RemoveContext (PerformanceInterface::ContextId contextId)
 Remove a context. More...
 
void AddInternalMarker (const PerformanceMarker &marker)
 Add an internal marker (e.g. More...
 
void AddCustomMarker (const PerformanceMarker &marker, PerformanceInterface::ContextId contextId)
 Add a custom marker defined by the application. More...
 
const char *const GetContextName (PerformanceInterface::ContextId contextId) const
 Get the nane of a context. More...
 
const char *const GetMarkerDescription (PerformanceInterface::MarkerType type, PerformanceInterface::ContextId contextId) const
 Get the full description of a marker for this context. More...
 
void EnableLogging (bool enable, PerformanceInterface::ContextId contextId)
 enable / disable logging for a context More...
 
void SetLoggingLevel (unsigned int statisticsLogOptions, unsigned int logFrequency)
 set global logging level and frequency. More...
 
void SetLoggingFrequency (unsigned int logFrequency, PerformanceInterface::ContextId contextId)
 Set the frequency of logging for an individual context. More...
 

Private Types

typedef Dali::Vector
< StatContext * > 
StatContexts
 

Private Member Functions

StatContextGetContext (PerformanceInterface::ContextId contextId) const
 helper More...
 

Private Attributes

Dali::Mutex mDataMutex
 mutex More...
 
StatContexts mStatContexts
 The list of stat contexts. More...
 
StatContextLogInterfacemLogInterface
 Log interface. More...
 
PerformanceInterface::ContextId mNextContextId
 The next valid context ID. More...
 
PerformanceInterface::ContextId mUpdateStats
 update time statistics More...
 
PerformanceInterface::ContextId mRenderStats
 render time statistics More...
 
PerformanceInterface::ContextId mEventStats
 event time statistics More...
 
unsigned int mStatisticsLogBitmask
 statistics log bitmask More...
 
unsigned int mLogFrequency
 log frequency More...
 

Detailed Description

Class to manage StatContext objects.

Contains 3 built in contexts for event, update, render. The application developer can add more using the PerformanceLogger public API

Example output of 4 contexts ( event, update, render and a custom one):

Event, min 0.04 ms, max 5.27 ms, total (0.1 secs), avg 0.28 ms, std dev 0.73 ms Update, min 0.29 ms, max 0.91 ms, total (0.5 secs), avg 0.68 ms, std dev 0.15 ms Render, min 0.33 ms, max 0.97 ms, total (0.6 secs), avg 0.73 ms, std dev 0.17 ms MyAppTask, min 76.55 ms, max 76.55 ms, total (0.1 secs), avg 76.55 ms, std dev 0.00 ms (CUSTOM CONTEXT)

Definition at line 53 of file stat-context-manager.h.

Member Typedef Documentation

Definition at line 135 of file stat-context-manager.h.

Constructor & Destructor Documentation

Dali::Internal::Adaptor::StatContextManager::StatContextManager ( StatContextLogInterface logInterface)
Dali::Internal::Adaptor::StatContextManager::~StatContextManager ( )

destructor, not intended as a bass class

Definition at line 57 of file stat-context-manager.cpp.

References Dali::Vector< T, IsTrivialType >::Begin(), Dali::Vector< T, IsTrivialType >::Clear(), Dali::Vector< T, IsTrivialType >::End(), and mStatContexts.

Here is the call graph for this function:

Member Function Documentation

PerformanceInterface::ContextId Dali::Internal::Adaptor::StatContextManager::AddContext ( const char *const  name,
PerformanceMarker::MarkerFilter  type 
)

Add a context.

Parameters
[in]nameName of the context to print in console
[in]typethe type of events to filter ( e.g. event, update, render or custom)
Returns
The ID to give the context

Definition at line 66 of file stat-context-manager.cpp.

References DALI_ASSERT_DEBUG, Dali::Internal::Adaptor::StatContext::EnableLogging(), GetContext(), Dali::Internal::Adaptor::PerformanceInterface::LOG_CUSTOM_MARKERS, mLogFrequency, mLogInterface, mNextContextId, mStatContexts, mStatisticsLogBitmask, and Dali::Vector< T, IsTrivialType >::PushBack().

Referenced by Dali::Internal::Adaptor::PerformanceServer::AddContext(), and StatContextManager().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Adaptor::StatContextManager::AddCustomMarker ( const PerformanceMarker marker,
PerformanceInterface::ContextId  contextId 
)

Add a custom marker defined by the application.

Parameters
[in]markerthe marker to add
[in]contextIdthe context the custom marker is designed for

Definition at line 99 of file stat-context-manager.cpp.

References GetContext(), mDataMutex, and Dali::Internal::Adaptor::StatContext::ProcessCustomMarker().

Referenced by Dali::Internal::Adaptor::PerformanceServer::AddMarker().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Adaptor::StatContextManager::AddInternalMarker ( const PerformanceMarker marker)

Add an internal marker (e.g.

v-sync, update, render markers)

Parameters
[in]markerthe marker to add

Definition at line 87 of file stat-context-manager.cpp.

References Dali::Vector< T, IsTrivialType >::Begin(), Dali::Vector< T, IsTrivialType >::End(), mDataMutex, mStatContexts, and Dali::Internal::Adaptor::StatContext::ProcessInternalMarker().

Referenced by Dali::Internal::Adaptor::PerformanceServer::AddMarker().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Adaptor::StatContextManager::EnableLogging ( bool  enable,
PerformanceInterface::ContextId  contextId 
)

enable / disable logging for a context

Parameters
[in]enablewhether to enable logging
[in]contextIdthe context to configure

Definition at line 127 of file stat-context-manager.cpp.

References Dali::Internal::Adaptor::StatContext::EnableLogging(), and GetContext().

Referenced by Dali::Internal::Adaptor::PerformanceServer::EnableLogging(), and SetLoggingLevel().

Here is the call graph for this function:

Here is the caller graph for this function:

StatContext * Dali::Internal::Adaptor::StatContextManager::GetContext ( PerformanceInterface::ContextId  contextId) const
private

helper

Parameters
[in]contextIdthe context to get
Returns
context

Definition at line 198 of file stat-context-manager.cpp.

References Dali::Vector< T, IsTrivialType >::Begin(), Dali::Vector< T, IsTrivialType >::End(), Dali::Internal::Adaptor::StatContext::GetId(), and mStatContexts.

Referenced by AddContext(), AddCustomMarker(), EnableLogging(), GetContextName(), GetMarkerDescription(), and SetLoggingFrequency().

Here is the call graph for this function:

Here is the caller graph for this function:

const char *const Dali::Internal::Adaptor::StatContextManager::GetContextName ( PerformanceInterface::ContextId  contextId) const

Get the nane of a context.

Parameters
[in]contextIdid of the context to get the name
Returns
context name

Definition at line 177 of file stat-context-manager.cpp.

References GetContext(), and Dali::Internal::Adaptor::StatContext::GetName().

Here is the call graph for this function:

const char *const Dali::Internal::Adaptor::StatContextManager::GetMarkerDescription ( PerformanceInterface::MarkerType  type,
PerformanceInterface::ContextId  contextId 
) const

Get the full description of a marker for this context.

Parameters
[in]typemarker type, for a customer marker this will be either START or END
[in]contextIdid of the context to get the name
Returns
marker description in relation to this context

Definition at line 187 of file stat-context-manager.cpp.

References GetContext(), and Dali::Internal::Adaptor::StatContext::GetMarkerDescription().

Referenced by Dali::Internal::Adaptor::PerformanceServer::AddMarker().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Adaptor::StatContextManager::RemoveContext ( PerformanceInterface::ContextId  contextId)

Remove a context.

Parameters
[in]contextIdid of the context to remove

Definition at line 111 of file stat-context-manager.cpp.

References Dali::Vector< T, IsTrivialType >::Begin(), Dali::Vector< T, IsTrivialType >::End(), Dali::Vector< T, IsTrivialType >::Erase(), Dali::Internal::Adaptor::StatContext::GetId(), and mStatContexts.

Referenced by Dali::Internal::Adaptor::PerformanceServer::RemoveContext().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Adaptor::StatContextManager::SetLoggingFrequency ( unsigned int  logFrequency,
PerformanceInterface::ContextId  contextId 
)

Set the frequency of logging for an individual context.

Parameters
[in]logFrequencylog frequency in seconds
[in]contextIdthe context to configure

Definition at line 164 of file stat-context-manager.cpp.

References Dali::Internal::Adaptor::anonymous_namespace{stat-context-manager.cpp}::DEFAULT_LOG_FREQUENCY, GetContext(), and Dali::Internal::Adaptor::StatContext::SetLogFrequency().

Referenced by Dali::Internal::Adaptor::PerformanceServer::SetLoggingFrequency().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Adaptor::StatContextManager::SetLoggingLevel ( unsigned int  statisticsLogOptions,
unsigned int  logFrequency 
)

Member Data Documentation

Dali::Mutex Dali::Internal::Adaptor::StatContextManager::mDataMutex
private

mutex

Definition at line 144 of file stat-context-manager.h.

Referenced by AddCustomMarker(), and AddInternalMarker().

PerformanceInterface::ContextId Dali::Internal::Adaptor::StatContextManager::mEventStats
private

event time statistics

Definition at line 153 of file stat-context-manager.h.

Referenced by SetLoggingLevel(), and StatContextManager().

unsigned int Dali::Internal::Adaptor::StatContextManager::mLogFrequency
private

log frequency

Definition at line 156 of file stat-context-manager.h.

Referenced by AddContext(), and SetLoggingLevel().

StatContextLogInterface& Dali::Internal::Adaptor::StatContextManager::mLogInterface
private

Log interface.

Definition at line 146 of file stat-context-manager.h.

Referenced by AddContext().

PerformanceInterface::ContextId Dali::Internal::Adaptor::StatContextManager::mNextContextId
private

The next valid context ID.

Definition at line 148 of file stat-context-manager.h.

Referenced by AddContext().

PerformanceInterface::ContextId Dali::Internal::Adaptor::StatContextManager::mRenderStats
private

render time statistics

Definition at line 152 of file stat-context-manager.h.

Referenced by SetLoggingLevel(), and StatContextManager().

StatContexts Dali::Internal::Adaptor::StatContextManager::mStatContexts
private
unsigned int Dali::Internal::Adaptor::StatContextManager::mStatisticsLogBitmask
private

statistics log bitmask

Definition at line 155 of file stat-context-manager.h.

Referenced by AddContext(), and SetLoggingLevel().

PerformanceInterface::ContextId Dali::Internal::Adaptor::StatContextManager::mUpdateStats
private

update time statistics

Definition at line 151 of file stat-context-manager.h.

Referenced by SetLoggingLevel(), and StatContextManager().


The documentation for this class was generated from the following files:
Dali Docs Home
Read more about Dali