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

Stores and prints statistics for a particular logging context. More...

#include <stat-context.h>

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

Public Member Functions

 StatContext (unsigned int id, const char *const contextName, PerformanceMarker::MarkerFilter contextType, unsigned int logFrequencySeconds, StatContextLogInterface &logInterface)
 Constructor. More...
 
 ~StatContext ()
 Non-virtual destructor, not intended as a base class. More...
 
unsigned int GetId () const
 
const char *const GetName () const
 
const char *const GetMarkerDescription (PerformanceInterface::MarkerType type) const
 For logging we want to output the name of the context with either START / END appended to the end. More...
 
void SetLogFrequency (unsigned int logFrequencySeconds)
 Set the frequency for logging. More...
 
void EnableLogging (bool enableLogging)
 enable/disable logging More...
 
void ProcessCustomMarker (const PerformanceMarker &marker)
 Process a custom marker from the application. More...
 
void ProcessInternalMarker (const PerformanceMarker &marker)
 Process a internal marker from DALi (V_SYNC/ UPDATE /RENDER/ EVENT ) More...
 

Private Member Functions

void RecordMarker (const PerformanceMarker &marker)
 Record marker. More...
 
void FrameTick (const PerformanceMarker &marker)
 Called when V-SYNC occurs to indicate a frame tick. More...
 
void LogMarker ()
 Helper to print to console. More...
 
 StatContext ()
 undefined default constructor More...
 
 StatContext (const StatContext &)
 undefined copy constructor More...
 
StatContextoperator= (const StatContext &)
 undefined assignment operator More...
 

Private Attributes

PerformanceMarker mInitialMarker
 Used to store initial time. More...
 
FrameTimeStats mStats
 Frame time stats to accumulate. More...
 
const char *const mName
 Name of the context. More...
 
char * mTempLogBuffer
 Temporary log buffer. More...
 
StatContextLogInterfacemLogInterface
 Log interface. More...
 
const std::string mNamePlusStart
 Name of the context + _START. More...
 
const std::string mNamePlusEnd
 Name of the context + _END. More...
 
unsigned int mId
 The ID of the context. More...
 
unsigned int mLogFrequencyMicroseconds
 if logging is enabled, what frequency to log out at in micro-seconds More...
 
PerformanceMarker::MarkerFilter mFilterType
 type of events the context is filtering More...
 
bool mLoggingEnabled:1
 Whether to print the log for this context or not. More...
 
bool mInitialMarkerSet:1
 Whether the initial marker has been set. More...
 

Detailed Description

Stores and prints statistics for a particular logging context.

Definition at line 43 of file stat-context.h.

Constructor & Destructor Documentation

Dali::Internal::Adaptor::StatContext::StatContext ( unsigned int  id,
const char *const  contextName,
PerformanceMarker::MarkerFilter  contextType,
unsigned int  logFrequencySeconds,
StatContextLogInterface logInterface 
)

Constructor.

Parameters
[in]idThe ID to give the context
[in]contextNameName of the context to print in console
[in]contextTypethe type of events to filter ( e.g. event, update, render or custom)
[in]logFrequencySecondsfrequency to log in seconds
[in]logInterfaceinterface to log out to

Definition at line 49 of file stat-context.cpp.

References Dali::Internal::Adaptor::anonymous_namespace{stat-context.cpp}::CONTEXT_LOG_SIZE, and mTempLogBuffer.

Dali::Internal::Adaptor::StatContext::~StatContext ( )

Non-virtual destructor, not intended as a base class.

Definition at line 68 of file stat-context.cpp.

References mTempLogBuffer.

Dali::Internal::Adaptor::StatContext::StatContext ( )
private

undefined default constructor

Dali::Internal::Adaptor::StatContext::StatContext ( const StatContext )
private

undefined copy constructor

Member Function Documentation

void Dali::Internal::Adaptor::StatContext::EnableLogging ( bool  enableLogging)

enable/disable logging

Parameters
[in]enableLoggingFlag to spePerformancecify enabling/disabling

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

References mLoggingEnabled.

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

Here is the caller graph for this function:

void Dali::Internal::Adaptor::StatContext::FrameTick ( const PerformanceMarker marker)
private

Called when V-SYNC occurs to indicate a frame tick.

Parameters
[in]markerthe marker containing a v-sync

Definition at line 137 of file stat-context.cpp.

References LogMarker(), Dali::Internal::Adaptor::PerformanceMarker::MicrosecondDiff(), mInitialMarker, mInitialMarkerSet, mLogFrequencyMicroseconds, mLoggingEnabled, mStats, and Dali::Internal::Adaptor::FrameTimeStats::Reset().

Referenced by ProcessInternalMarker().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int Dali::Internal::Adaptor::StatContext::GetId ( ) const
Returns
Return the context ID

Definition at line 72 of file stat-context.cpp.

References mId.

Referenced by Dali::Internal::Adaptor::StatContextManager::GetContext(), and Dali::Internal::Adaptor::StatContextManager::RemoveContext().

Here is the caller graph for this function:

const char *const Dali::Internal::Adaptor::StatContext::GetMarkerDescription ( PerformanceInterface::MarkerType  type) const

For logging we want to output the name of the context with either START / END appended to the end.

E.g. MY_MARKER_START

Parameters
[in]typemarker type, for a customer marker this will be either START or END
Returns
the full description for a marker

Definition at line 82 of file stat-context.cpp.

References Dali::Internal::Adaptor::PerformanceInterface::END, mNamePlusEnd, mNamePlusStart, Dali::Internal::Adaptor::PerformanceInterface::START, and Dali::Internal::Adaptor::anonymous_namespace{stat-context.cpp}::UNKNOWN_CONTEXT_NAME.

Referenced by Dali::Internal::Adaptor::StatContextManager::GetMarkerDescription().

Here is the caller graph for this function:

const char *const Dali::Internal::Adaptor::StatContext::GetName ( ) const
Returns
the context name

Definition at line 77 of file stat-context.cpp.

References mName.

Referenced by Dali::Internal::Adaptor::StatContextManager::GetContextName().

Here is the caller graph for this function:

void Dali::Internal::Adaptor::StatContext::LogMarker ( )
private
StatContext& Dali::Internal::Adaptor::StatContext::operator= ( const StatContext )
private

undefined assignment operator

void Dali::Internal::Adaptor::StatContext::ProcessCustomMarker ( const PerformanceMarker marker)

Process a custom marker from the application.

Parameters
[in]markerThe marker to log

Definition at line 104 of file stat-context.cpp.

References RecordMarker().

Referenced by Dali::Internal::Adaptor::StatContextManager::AddCustomMarker().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Adaptor::StatContext::ProcessInternalMarker ( const PerformanceMarker marker)

Process a internal marker from DALi (V_SYNC/ UPDATE /RENDER/ EVENT )

Parameters
[in]markerThe marker to log

Definition at line 110 of file stat-context.cpp.

References FrameTick(), Dali::Internal::Adaptor::PerformanceMarker::GetType(), Dali::Internal::Adaptor::PerformanceMarker::IsFilterEnabled(), mFilterType, RecordMarker(), and Dali::Internal::Adaptor::PerformanceInterface::VSYNC.

Referenced by Dali::Internal::Adaptor::StatContextManager::AddInternalMarker().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Adaptor::StatContext::RecordMarker ( const PerformanceMarker marker)
private
void Dali::Internal::Adaptor::StatContext::SetLogFrequency ( unsigned int  logFrequencySeconds)

Set the frequency for logging.

Parameters
[in]logFrequencySecondsThe log frequency to set in seconds

Definition at line 94 of file stat-context.cpp.

References Dali::Internal::Adaptor::anonymous_namespace{stat-context.cpp}::MICROSECONDS_PER_SECOND, and mLogFrequencyMicroseconds.

Referenced by Dali::Internal::Adaptor::StatContextManager::SetLoggingFrequency(), and Dali::Internal::Adaptor::StatContextManager::SetLoggingLevel().

Here is the caller graph for this function:

Member Data Documentation

PerformanceMarker::MarkerFilter Dali::Internal::Adaptor::StatContext::mFilterType
private

type of events the context is filtering

Definition at line 157 of file stat-context.h.

Referenced by ProcessInternalMarker().

unsigned int Dali::Internal::Adaptor::StatContext::mId
private

The ID of the context.

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

Referenced by GetId().

PerformanceMarker Dali::Internal::Adaptor::StatContext::mInitialMarker
private

Used to store initial time.

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

Referenced by FrameTick().

bool Dali::Internal::Adaptor::StatContext::mInitialMarkerSet
private

Whether the initial marker has been set.

Definition at line 159 of file stat-context.h.

Referenced by FrameTick().

unsigned int Dali::Internal::Adaptor::StatContext::mLogFrequencyMicroseconds
private

if logging is enabled, what frequency to log out at in micro-seconds

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

Referenced by FrameTick(), and SetLogFrequency().

bool Dali::Internal::Adaptor::StatContext::mLoggingEnabled
private

Whether to print the log for this context or not.

Definition at line 158 of file stat-context.h.

Referenced by EnableLogging(), and FrameTick().

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

Log interface.

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

Referenced by LogMarker().

const char* const Dali::Internal::Adaptor::StatContext::mName
private

Name of the context.

Definition at line 150 of file stat-context.h.

Referenced by GetName(), and LogMarker().

const std::string Dali::Internal::Adaptor::StatContext::mNamePlusEnd
private

Name of the context + _END.

Definition at line 154 of file stat-context.h.

Referenced by GetMarkerDescription().

const std::string Dali::Internal::Adaptor::StatContext::mNamePlusStart
private

Name of the context + _START.

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

Referenced by GetMarkerDescription().

FrameTimeStats Dali::Internal::Adaptor::StatContext::mStats
private

Frame time stats to accumulate.

Definition at line 149 of file stat-context.h.

Referenced by FrameTick(), LogMarker(), and RecordMarker().

char* Dali::Internal::Adaptor::StatContext::mTempLogBuffer
private

Temporary log buffer.

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

Referenced by LogMarker(), StatContext(), and ~StatContext().


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