VoltAir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
Public Slots | Signals | Public Member Functions | Properties | List of all members
DebugMetricsMonitor Class Reference

Tracks and provides mechanisms for reporting various debug metrics. More...

Inheritance diagram for DebugMetricsMonitor:
QObject

Public Slots

void update ()
 Updates the DebugMetricsMonitor metrics if more than their refresh interval times have passed since they were last refreshed. More...
 

Signals

void fpsChanged ()
 Emitted when fps changes. More...
 
void fpsAverageWindowSizeMsChanged ()
 Emitted when fpsAverageWindowSizeMs changes. More...
 
void fpsRefreshIntervalMsChanged ()
 Emitted when fpsRefreshIntervalMs changes. More...
 
void memoryUsageChanged ()
 Emitted when memoryUsage changes. More...
 
void memoryUsageRefreshIntervalMsChanged ()
 Emitted when memoryUsageRefreshIntervalMs changes. More...
 
void loggingMetricsChanged ()
 Emitted when loggingMetrics changes. More...
 

Public Member Functions

 DebugMetricsMonitor (QObject *parent=0)
 Constructs a DebugMetricsMonitor. More...
 
float getFps () const
 Returns fps. More...
 
int getFpsAverageWindowSizeMs () const
 Returns fpsAverageWindowSizeMs. More...
 
void setFpsAverageWindowSizeMs (int value)
 Sets fpsAverageWindowSizeMs. More...
 
int getFpsRefreshIntervalMs () const
 Returns fpsRefreshIntervalMs. More...
 
void setFpsRefreshIntervalMs (int value)
 Sets fpsRefreshIntervalMs. More...
 
float getInstantFps () const
 Returns instantFps. More...
 
long getMemoryUsage () const
 Returns memoryUsage. More...
 
int getMemoryUsageRefreshIntervalMs () const
 Returns memoryUsageRefreshIntervalMs. More...
 
void setMemoryUsageRefreshIntervalMs (int value)
 Sets memoryUsageRefreshIntervalMs. More...
 
bool isLoggingMetrics () const
 Returns loggingMetrics. More...
 
void setLoggingMetrics (bool value)
 Sets loggingMetrics. More...
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
virtual const QMetaObjectmetaObject () const
 
QString objectName () const
 
void setObjectName (const QString &name)
 
bool isWidgetType () const
 
bool isWindowType () const
 
bool signalsBlocked () const
 
bool blockSignals (bool block)
 
QThreadthread () const
 
void moveToThread (QThread *targetThread)
 
int startTimer (int interval, Qt::TimerType timerType)
 
void killTimer (int id)
 
findChild (const QString &name, QFlags< Qt::FindChildOption > options) const
 
QList< T > findChildren (const QString &name, QFlags< Qt::FindChildOption > options) const
 
QList< T > findChildren (const QRegExp &regExp, QFlags< Qt::FindChildOption > options) const
 
QList< T > findChildren (const QRegularExpression &re, QFlags< Qt::FindChildOption > options) const
 
const QObjectList & children () const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const
 
bool disconnect (const QObject *receiver, const char *method) const
 
void dumpObjectTree ()
 
void dumpObjectInfo ()
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const
 
QList< QByteArraydynamicPropertyNames () const
 
void destroyed (QObject *obj)
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const
 
bool inherits (const char *className) const
 
void deleteLater ()
 

Properties

float fps
 Average number of frames rendered per second, averaged over fpsAverageWindowSizeMs milliseconds and updated every fpsRefreshIntervalMs milliseconds. More...
 
int fpsAverageWindowSizeMs
 Size of window, in milliseconds, over which to average fps. More...
 
int fpsRefreshIntervalMs
 Length of interval, in milliseconds, after which to refresh the fps metric. More...
 
float instantFps
 The most immediate, non-averaged measurement of the number of frames rendered per second that is updated each frame. More...
 
long int memoryUsage
 Amount of memory, in bytes, used by the application. More...
 
int memoryUsageRefreshIntervalMs
 Length of interval, in milliseconds, after which to refresh the memoryUsage metric. More...
 
bool loggingMetrics
 Whether or not DebugMetricsMonitor logs debug information to qDebug. More...
 
- Properties inherited from QObject
 objectName
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 

Detailed Description

Tracks and provides mechanisms for reporting various debug metrics.

Current metrics that are supported include: frames rendered per second and application memory usage.

Note
In order for DebugMetricsMonitor to report correctly, update() must be called every frame.

Constructor & Destructor Documentation

DebugMetricsMonitor::DebugMetricsMonitor ( QObject parent = 0)
explicit

Constructs a DebugMetricsMonitor.

Parameters
parentParent object

Member Function Documentation

void DebugMetricsMonitor::fpsAverageWindowSizeMsChanged ( )
signal

Emitted when fpsAverageWindowSizeMs changes.

void DebugMetricsMonitor::fpsChanged ( )
signal

Emitted when fps changes.

void DebugMetricsMonitor::fpsRefreshIntervalMsChanged ( )
signal

Emitted when fpsRefreshIntervalMs changes.

float DebugMetricsMonitor::getFps ( ) const
inline

Returns fps.

int DebugMetricsMonitor::getFpsAverageWindowSizeMs ( ) const
inline
int DebugMetricsMonitor::getFpsRefreshIntervalMs ( ) const
inline
float DebugMetricsMonitor::getInstantFps ( ) const
inline

Returns instantFps.

long DebugMetricsMonitor::getMemoryUsage ( ) const
inline

Returns memoryUsage.

int DebugMetricsMonitor::getMemoryUsageRefreshIntervalMs ( ) const
inline
bool DebugMetricsMonitor::isLoggingMetrics ( ) const
inline

Returns loggingMetrics.

void DebugMetricsMonitor::loggingMetricsChanged ( )
signal

Emitted when loggingMetrics changes.

void DebugMetricsMonitor::memoryUsageChanged ( )
signal

Emitted when memoryUsage changes.

void DebugMetricsMonitor::memoryUsageRefreshIntervalMsChanged ( )
signal

Emitted when memoryUsageRefreshIntervalMs changes.

void DebugMetricsMonitor::setFpsAverageWindowSizeMs ( int  value)

Sets fpsAverageWindowSizeMs.

Parameters
valueInteger to set fpsAverageWindowSizeMs to
void DebugMetricsMonitor::setFpsRefreshIntervalMs ( int  value)

Sets fpsRefreshIntervalMs.

Parameters
valueInteger to set fpsRefreshIntervalMs to
void DebugMetricsMonitor::setLoggingMetrics ( bool  value)

Sets loggingMetrics.

Parameters
valueBoolean to set loggingMetrics to
void DebugMetricsMonitor::setMemoryUsageRefreshIntervalMs ( int  value)

Sets memoryUsageRefreshIntervalMs.

Parameters
valueInteger to set memoryUsageRefreshIntervalMs to
void DebugMetricsMonitor::update ( )
slot

Updates the DebugMetricsMonitor metrics if more than their refresh interval times have passed since they were last refreshed.

Note
This function should be called each frame to ensure accurate metrics.

Property Documentation

float DebugMetricsMonitor::fps
read

Average number of frames rendered per second, averaged over fpsAverageWindowSizeMs milliseconds and updated every fpsRefreshIntervalMs milliseconds.

int DebugMetricsMonitor::fpsAverageWindowSizeMs
readwrite

Size of window, in milliseconds, over which to average fps.

int DebugMetricsMonitor::fpsRefreshIntervalMs
readwrite

Length of interval, in milliseconds, after which to refresh the fps metric.

float DebugMetricsMonitor::instantFps
read

The most immediate, non-averaged measurement of the number of frames rendered per second that is updated each frame.

bool DebugMetricsMonitor::loggingMetrics
readwrite

Whether or not DebugMetricsMonitor logs debug information to qDebug.

Note
Currently only the fps metric is logged.
long int DebugMetricsMonitor::memoryUsage
read

Amount of memory, in bytes, used by the application.

int DebugMetricsMonitor::memoryUsageRefreshIntervalMs
readwrite

Length of interval, in milliseconds, after which to refresh the memoryUsage metric.