A simple statistics gathering class.
Per-frame values are added via the addSample method. General non-per-frame stats can be added as members of this class as needed.
#include <PerformanceMonitor.h>
Classes |
|
class | PerformanceStats |
Public Types |
|
enum | QualityMode { kAutomaticQuality, kLockedQuality, kIdleQuality } |
Public Member Functions |
|
PerformanceMonitor (int historyLength) | |
virtual | ~PerformanceMonitor () |
int | getHistoryLength () const |
void | setRefreshRate (int fps) |
Users of this class often do not have direct
access to the display information so we provide hooks here to set
and get the refresh rate used by the current display device.
|
|
int | getRefreshRate () const |
void | addSample (double clockTime) |
Call addSample to add a new sample to the
monitor. |
|
double | getLastFrameTime () const |
double | getAverageFrameTime (int overHowMany) const |
void | setScreenSize (int width, int height) |
void | getScreenSize (int &width, int &height) const |
int | getQualityMode () const |
Performance and Quality Settings: all int
values should be positive. |
|
void | setQualityMode (int) |
bool | setIgnoreIdleMode (bool b) |
set returns the previous value of
IgnoreIdleMode. |
|
bool | getIgnoreIdleMode () const |
bool | setForceAlwaysDraw (bool b) |
When set, even if nothing changes, we will
keep re-drawing keeping the CPU and GPU busy. |
|
bool | getForceAlwaysDraw () const |
void | setQualityLevel (int level) |
Quality level: a number between 0-100.
|
|
int | getQualityLevel () const |
void | setMinFPS (int fps) |
Frame per second: a number between 0 and
100. |
|
int | getMinFPS () const |
void | setLockMode_AntiAliasQualityLevel (const int lockedQuality) |
Anti-aliasing section NOTE: 'Anti-aliasing
Quality Level' values are integers (0~9) |
|
int | getLockMode_AntiAliasQualityLevel () const |
void | setAutoMode_AntiAliasQualityLevel (const int minQuality) |
int | getAutoMode_AntiAliasQualityLevel () const |
void | setAutoMode_IncreaseAntiAliasOnIdle (const bool flag) |
bool | getAutoMode_IncreaseAntiAliasOnIdle () const |
void | setAutoMode_EnableAntiAliasOnIdle (const bool flag) |
bool | getAutoMode_EnableAntiAliasOnIdle () const |
int | getOriginalNodeCount () const |
Consolidation section. |
|
void | setOriginalNodeCount (const int count) |
int | getEffectiveNodeCount () const |
void | setEffectiveNodeCount (const int count) |
int | getConsolidatedNodeCount () const |
void | setConsolidatedNodeCount (const int count) |
int | getEffectInstanceCount () const |
void | setEffectInstanceCount (const int count) |
int | getGraphicSchemeCount () const |
void | setGraphicSchemeCount (const int count) |
int | getProcessHandleCount () |
Return the total number of currently active
handles in this process. |
|
size_t | getProcessMemorySize () |
Return the current working set (in memory)
size for this process in kilobytes. |
|
size_t | getProcessPageMemorySize () |
Return the total size of this process in
kilobytes. |
|
Static Public Member Functions |
|
static PerformanceMonitor & | instance () |
Applications that wish to share a common
statistics object can use the instance and destruct methods...
|
|
static void | destruct () |
Static Public Attributes |
|
static awRTB::SignalArg< int > | sigQualityModeChanged |
If you want to know when the quality mode
has changed, connect yourself to this signal. |
enum QualityMode |
PerformanceMonitor | ( | int | historyLength | ) | [explicit] |
virtual ~PerformanceMonitor | ( | ) | [virtual] |
static PerformanceMonitor& instance | ( | ) | [static] |
Applications that wish to share a common statistics object can use the instance and destruct methods...
static void destruct | ( | ) | [static] |
int getHistoryLength | ( | ) | const |
void setRefreshRate | ( | int | fps | ) |
Users of this class often do not have direct access to the display information so we provide hooks here to set and get the refresh rate used by the current display device.
int getRefreshRate | ( | ) | const |
void addSample | ( | double | clockTime | ) |
Call addSample to add a new sample to the monitor.
Time stamps are assumed to be non-decreasing.
Current plan is to extend the interface to addSample as needed...
double getLastFrameTime | ( | ) | const |
double getAverageFrameTime | ( | int | overHowMany | ) | const |
void setScreenSize | ( | int | width, |
int | height | ||
) |
void getScreenSize | ( | int & | width, |
int & | height | ||
) | const |
int getQualityMode | ( | ) | const |
Performance and Quality Settings: all int values should be positive.
void setQualityMode | ( | int | ) |
bool setIgnoreIdleMode | ( | bool | b | ) |
set returns the previous value of IgnoreIdleMode.
This is used for quality improvements during idle. Do not mix it up with "ForceAlwaysDraw" setting.
bool getIgnoreIdleMode | ( | ) | const |
bool setForceAlwaysDraw | ( | bool | b | ) |
When set, even if nothing changes, we will keep re-drawing keeping the CPU and GPU busy.
bool getForceAlwaysDraw | ( | ) | const |
void setQualityLevel | ( | int | level | ) |
Quality level: a number between 0-100.
int getQualityLevel | ( | ) | const |
void setMinFPS | ( | int | fps | ) |
Frame per second: a number between 0 and 100.
int getMinFPS | ( | ) | const |
void setLockMode_AntiAliasQualityLevel | ( | const int | lockedQuality | ) |
Anti-aliasing section NOTE: 'Anti-aliasing Quality Level' values are integers (0~9)
int getLockMode_AntiAliasQualityLevel | ( | ) | const |
void setAutoMode_AntiAliasQualityLevel | ( | const int | minQuality | ) |
int getAutoMode_AntiAliasQualityLevel | ( | ) | const |
void setAutoMode_IncreaseAntiAliasOnIdle | ( | const bool | flag | ) |
bool getAutoMode_IncreaseAntiAliasOnIdle | ( | ) | const |
void setAutoMode_EnableAntiAliasOnIdle | ( | const bool | flag | ) |
bool getAutoMode_EnableAntiAliasOnIdle | ( | ) | const |
int getOriginalNodeCount | ( | ) | const |
Consolidation section.
void setOriginalNodeCount | ( | const int | count | ) |
int getEffectiveNodeCount | ( | ) | const |
void setEffectiveNodeCount | ( | const int | count | ) |
int getConsolidatedNodeCount | ( | ) | const |
void setConsolidatedNodeCount | ( | const int | count | ) |
int getEffectInstanceCount | ( | ) | const |
void setEffectInstanceCount | ( | const int | count | ) |
int getGraphicSchemeCount | ( | ) | const |
void setGraphicSchemeCount | ( | const int | count | ) |
int getProcessHandleCount | ( | ) |
Return the total number of currently active handles in this process.
size_t getProcessMemorySize | ( | ) |
Return the current working set (in memory) size for this process in kilobytes.
size_t getProcessPageMemorySize | ( | ) |
Return the total size of this process in kilobytes.
awRTB::SignalArg<int>
sigQualityModeChanged [static] |
If you want to know when the quality mode has changed, connect yourself to this signal.