Guiliani  Version 2.6 revision 7293 (documentation build 12)
CGUIProfiler Class Reference

#include <GUIProfiler.h>

Inheritance diagram for CGUIProfiler:

Public Types

enum  FPSCounterID { INVALID_COUNTER_ID = -1 , DEFAULT_FPS , DEFAULT_ABS_FPS }
 

Public Member Functions

void ClearMemoryLargestBlock ()
 
void ClearMemoryMax ()
 
virtual void DoAnimate (const eC_Value &vTimes=eC_FromInt(1))
 
eC_UInt GetCPUUsage () const
 
size_t GetMemoryAvailable () const
 
size_t GetMemoryLargestBlock () const
 
size_t GetMemoryMax () const
 
void GetMemoryThresholds (size_t &uiMemoryUsageWarning, size_t &uiMemoryUsageAlert)
 
size_t GetMemoryUsed () const
 
eC_UInt GetObjectCount ()
 
eC_Bool GetObjectCountActive () const
 
eC_UInt GetRedrawDuration () const
 
eC_UInt GetRefreshDuration () const
 
eC_Bool GetRuntimeActive () const
 
eC_Bool IsActive () const
 
eC_Bool IsConsoleActive () const
 
eC_Bool IsCPUProfilingActive () const
 
eC_Bool IsDisplayActive () const
 
eC_Bool IsFPSActive () const
 
eC_Bool IsGraphicsProfilingActive () const
 
eC_Bool IsInvalidationActive () const
 
eC_Bool IsMemoryProfilingActive () const
 
eC_Bool IsMemoryUsageBarActive () const
 
void SetActive (const eC_Bool &bActive)
 
void SetBackColor (const eC_UInt &uiBackColor)
 
void SetConsoleActive (const eC_Bool &bActive)
 
void SetCPUProfilingActive (const eC_Bool &bActive)
 
void SetDisplayActive (const eC_Bool &bActive)
 
void SetFont (const FontResource_t &eFontID)
 
void SetFPSActive (const eC_Bool &bActive)
 
void SetGraphicsProfilingActive (const eC_Bool &bActive)
 
void SetInvalidationActive (const eC_Bool &bActive)
 
void SetMemoryAvailable (const size_t &tMemoryAvailable)
 
void SetMemoryProfilingActive (const eC_Bool &bActive)
 
void SetMemoryThresholds (const size_t &uiMemoryUsageWarning, const size_t &uiMemoryUsageAlert)
 
void SetMemoryUsageBarActive (const eC_Bool &bActive)
 
void SetMemoryUsageBarPosition (const eC_Value &vX, const eC_Value &vY)
 
void SetMemoryUsageBarSize (const eC_Value &vWidth, const eC_Value &vHeight)
 
void SetObjectCountActive (const eC_Bool &bActive)
 
void SetPosition (const eC_Value &vX, const eC_Value &vY)
 
void SetRuntimeActive (const eC_Bool &bActive)
 
void SetTextColor (const eC_UInt &uiTextColor)
 
void SetUpdateInterval (const eC_UInt &uiUpdateInterval)
 
- Public Member Functions inherited from CGUIAnimatable
virtual ~CGUIAnimatable ()
 Destructor. Removes all existing animation callbacks.
 
virtual void DoAnimate (const eC_Value &vTimes=eC_FromInt(1))
 
virtual eC_Bool IsAnimating () const
 
virtual void StartAnimation ()
 
virtual void StopAnimation ()
 

Static Public Member Functions

static void CreateInstance ()
 
static void DeleteInstance ()
 

Friends

class CGfxWrap
 for private access
 
class CGUI
 for private access
 
class CGUIComponentManager
 for private access
 

Detailed Description

This class is used for profiling purposes in Guiliani.

You can measure the following things during runtime:

  • CPU

The CPU value is calculated by taking two different time-spans (processing time / complete time for one loop) The first one is the time which internal processing in Guiliani takes up. This one does not include acquiring new events from the InputDevice. This is done because, when there is no event the InputDevice will wait for a timeout. The second value is the time which elapses for the complete run.

So the term CPU-consumption might not be the correct one, since in a multi-tasking environment the scheduler might split one loop of Guiliani into several small parts, which are interrupted by other tasks. It is more like a percentage of the whole timeslice Guiliani has had to the part of the timeslice for processing. So 50% means that 50% of the time inside the Guiliani main-loop was spent for the input-device and 50% for processing, whereas 100% means that there was nearly no time consumed by waiting for events.

  • FPS

There are two different values for the FPS of Guiliani: 1. FPS measures only the time for redrawing the invalidated regions on the screen. This value may get really high if there is nothing to be drawn on the screen.

2. AbsFPS measures the time for a whole cycle through the main-loop of Guiliani, including processing time of internal stuff (Commands, DataPool, etc.) This value is comparable to the FPS-value you are used from games or other applications.

  • Memory

There a several measurements for memory-profiling available: 1. used memory the number of bytes currently used by allocation in Guiliani

2. maximum value for allocated memory 3. largest block ever allocated these two values can be reset during runtime for analyzing different situations

4. number of allocated blocks

Note: please keep in mind that only memory which is allocated by new/delete is counted. if you use the C-functions malloc/free the memory will not be tracked by the profiler.

It is also possible to display a bar of the consumed memory on the screen, where the color of the bar indicated if a threshold (which can be set seperately) was reached. The length of the bar is the total amount of memory available. The colored bar (green, yellow, red) indicates the currently used memory. The blue bar in the background indicates the maximum amount of allocated memory.

  • Graphics

for measuring graphics performance in various situations the duration of redraw and refresh are calculated and can be displayed during runtime.

Member Enumeration Documentation

◆ FPSCounterID

Enumeration for the counter IDs

Member Function Documentation

◆ ClearMemoryLargestBlock()

void CGUIProfiler::ClearMemoryLargestBlock ( )

Clear the value for the largest allocated block of memory

◆ ClearMemoryMax()

void CGUIProfiler::ClearMemoryMax ( )

Clear the value for maximum allocated memory

◆ CreateInstance()

static void CGUIProfiler::CreateInstance ( )
static

Create Instance

◆ DeleteInstance()

static void CGUIProfiler::DeleteInstance ( )
static

Delete Instance

◆ DoAnimate()

virtual void CGUIProfiler::DoAnimate ( const eC_Value &  vTimes = eC_FromInt(1))
virtual

Called when the timer of an animation callback belonging to this animatable has expired.

Parameters
vTimesThe factor of the registered callback time in relation to the actually elapsed time. For example, the elapsed time is 80ms, and the standard time is 50ms, then vTimes is 1.6. If the given time in GETTIMER.AddAnimationCallback is 0, It will be set to -1.

Reimplemented from CGUIAnimatable.

◆ GetCPUUsage()

eC_UInt CGUIProfiler::GetCPUUsage ( ) const

get the current CPU-Usage

Returns
CPU-usage

◆ GetMemoryAvailable()

size_t CGUIProfiler::GetMemoryAvailable ( ) const

Get the amount of available memory in bytes

Returns
available memory

◆ GetMemoryLargestBlock()

size_t CGUIProfiler::GetMemoryLargestBlock ( ) const

Get the largest block ever allocated

Returns
size of largest block in bytes

◆ GetMemoryMax()

size_t CGUIProfiler::GetMemoryMax ( ) const

Get the maximum amount of memory used

Returns
max in bytes

◆ GetMemoryThresholds()

void CGUIProfiler::GetMemoryThresholds ( size_t &  uiMemoryUsageWarning,
size_t &  uiMemoryUsageAlert 
)

get thresholds for memory usage

Parameters
uiMemoryUsageWarningwarning-level
uiMemoryUsageAlertalert-level

◆ GetMemoryUsed()

size_t CGUIProfiler::GetMemoryUsed ( ) const

Get amount of used memory

Returns
used memory in bytes

◆ GetObjectCount()

eC_UInt CGUIProfiler::GetObjectCount ( )

return the number of object used in the currently displayed GUI

Returns
number of objects

◆ GetObjectCountActive()

eC_Bool CGUIProfiler::GetObjectCountActive ( ) const
inline

return if object count is active

Returns
true if active

◆ GetRedrawDuration()

eC_UInt CGUIProfiler::GetRedrawDuration ( ) const

Get the duration of the last redraw

Returns
redraw-duration in ms

◆ GetRefreshDuration()

eC_UInt CGUIProfiler::GetRefreshDuration ( ) const

Get the duration of the last refresh

Returns
refresh-duration in ms

◆ GetRuntimeActive()

eC_Bool CGUIProfiler::GetRuntimeActive ( ) const
inline

return if Runtime is active

Returns
true if active

◆ IsActive()

eC_Bool CGUIProfiler::IsActive ( ) const
inline

get the active-state of the profiler

Returns
true if active

◆ IsConsoleActive()

eC_Bool CGUIProfiler::IsConsoleActive ( ) const
inline

return if the console-output is currently active

Returns
true if active

◆ IsCPUProfilingActive()

eC_Bool CGUIProfiler::IsCPUProfilingActive ( ) const
inline

return if CPU-profiling is currently active

Returns
true if active

◆ IsDisplayActive()

eC_Bool CGUIProfiler::IsDisplayActive ( ) const
inline

return if the onscreen-display is currently active

Returns
true if active

◆ IsFPSActive()

eC_Bool CGUIProfiler::IsFPSActive ( ) const
inline

return if FPS-measuring is currently active

Returns
true if active

◆ IsGraphicsProfilingActive()

eC_Bool CGUIProfiler::IsGraphicsProfilingActive ( ) const
inline

return if graphics-profiling is currently active

Returns
true if active

◆ IsInvalidationActive()

eC_Bool CGUIProfiler::IsInvalidationActive ( ) const
inline

return if invalidation is currently active

Returns
true if active

◆ IsMemoryProfilingActive()

eC_Bool CGUIProfiler::IsMemoryProfilingActive ( ) const
inline

return if the memory-profiling is currently active

Returns
true if active

◆ IsMemoryUsageBarActive()

eC_Bool CGUIProfiler::IsMemoryUsageBarActive ( ) const
inline

return if the memory-usage-bar is currently displayed

Returns
true if active

◆ SetActive()

void CGUIProfiler::SetActive ( const eC_Bool &  bActive)

Set profiler to active.

Parameters
bActive

◆ SetBackColor()

void CGUIProfiler::SetBackColor ( const eC_UInt &  uiBackColor)

Set the background-color

Parameters
uiBackColorcolor in ARGB

◆ SetConsoleActive()

void CGUIProfiler::SetConsoleActive ( const eC_Bool &  bActive)

Set logging of profiling-data to the console to active

Parameters
bActive

◆ SetCPUProfilingActive()

void CGUIProfiler::SetCPUProfilingActive ( const eC_Bool &  bActive)

Set profiling of CPU

Parameters
bActive

◆ SetDisplayActive()

void CGUIProfiler::SetDisplayActive ( const eC_Bool &  bActive)

Set logging of profiling-data on the screen to active

Parameters
bActive

◆ SetFont()

void CGUIProfiler::SetFont ( const FontResource_t eFontID)

Set the font-id

Parameters
eFontIDused font

◆ SetFPSActive()

void CGUIProfiler::SetFPSActive ( const eC_Bool &  bActive)

Set display of FPS-counters

Parameters
bActive

◆ SetGraphicsProfilingActive()

void CGUIProfiler::SetGraphicsProfilingActive ( const eC_Bool &  bActive)

Set profiling of graphics

Parameters
bActive

◆ SetInvalidationActive()

void CGUIProfiler::SetInvalidationActive ( const eC_Bool &  bActive)

Set display of invalidation

Parameters
bActive

◆ SetMemoryAvailable()

void CGUIProfiler::SetMemoryAvailable ( const size_t &  tMemoryAvailable)

Set the amount of available memory

Parameters
tMemoryAvailablenumber of bytes available

◆ SetMemoryProfilingActive()

void CGUIProfiler::SetMemoryProfilingActive ( const eC_Bool &  bActive)

Set profiling of memory-usage

Parameters
bActive

◆ SetMemoryThresholds()

void CGUIProfiler::SetMemoryThresholds ( const size_t &  uiMemoryUsageWarning,
const size_t &  uiMemoryUsageAlert 
)

set thresholds for memory usage

Parameters
uiMemoryUsageWarningwarning-level
uiMemoryUsageAlertalert-level

◆ SetMemoryUsageBarActive()

void CGUIProfiler::SetMemoryUsageBarActive ( const eC_Bool &  bActive)

Set display of current memory-usage as a bar

Parameters
bActive

◆ SetMemoryUsageBarPosition()

void CGUIProfiler::SetMemoryUsageBarPosition ( const eC_Value &  vX,
const eC_Value &  vY 
)

Set the position for the memory-bar

Parameters
vXx-position
vYy-position

◆ SetMemoryUsageBarSize()

void CGUIProfiler::SetMemoryUsageBarSize ( const eC_Value &  vWidth,
const eC_Value &  vHeight 
)

Set the size for the memory-bar

Parameters
vWidthwidth
vHeightheight

◆ SetObjectCountActive()

void CGUIProfiler::SetObjectCountActive ( const eC_Bool &  bActive)

Set display of object count

Parameters
bActive

◆ SetPosition()

void CGUIProfiler::SetPosition ( const eC_Value &  vX,
const eC_Value &  vY 
)

Set the position for the output

Parameters
vXx-position
vYy-position

◆ SetRuntimeActive()

void CGUIProfiler::SetRuntimeActive ( const eC_Bool &  bActive)

Set display of runtime

Parameters
bActive

◆ SetTextColor()

void CGUIProfiler::SetTextColor ( const eC_UInt &  uiTextColor)

Set the text-color

Parameters
uiTextColorcolor in ARGB

◆ SetUpdateInterval()

void CGUIProfiler::SetUpdateInterval ( const eC_UInt &  uiUpdateInterval)

Set the updating interval

Parameters
uiUpdateIntervaltime in milliseconds

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