VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes
DtPerformanceMonitor Class Reference

Public Types

typedef std::map< int, DtAveragerSectionTimes
 

Public Member Functions

 DtPerformanceMonitor ()
 
virtual void pause ()
 
virtual void resume ()
 
virtual bool isPaused () const
 
virtual void addSample (double frameTime, int section=-1)
 
virtual void adjustSample (int section, double frameTime)
 
virtual double meanFrameRate (int section=-1)
 
virtual double medianFrameRate (int section=-1)
 
virtual double standardDeviationFrameRate (int section=-1)
 
virtual double minimumFrameRate (int section=-1)
 
virtual double maximumFrameRate (int section=-1)
 
virtual double lastSample (int section=-1)
 
virtual void reset ()
 
virtual void setNumberOfFramesToAverage (unsigned int numFramesToAverage)
 
virtual unsigned int numberOfFramesToAverage ()
 
virtual int numSections () const
 
virtual int section (int index) const
 
virtual std::vector< intsections () const
 
const SectionTimessectionTimes () const
 
double currentFrameRate () const
 

Static Public Member Functions

static int AddProfileContextString (int context, const char *str)
 
static std::string ProfileContextString (int context)
 
static DtPerformanceMonitorInstance ()
 
static void DeleteInstance ()
 
static DtPerformanceMonitorSetInstance (DtPerformanceMonitor *)
 

Protected Attributes

SectionTimes mySectionTimes
 
bool myIsPaused
 
double myCurrentFrameRate
 
unsigned int myMaxPopulationSize
 

Static Protected Attributes

static std::map< int,
std::string > * 
theProfileContextStrings
 
static DtPerformanceMonitorthePerformanceMonitor
 

Member Typedef Documentation

Given an identifier to identify a section of code tha will measure simulation time based on that section.

Constructor & Destructor Documentation

DtPerformanceMonitor::DtPerformanceMonitor ( )

Member Function Documentation

static int DtPerformanceMonitor::AddProfileContextString ( int  context,
const char str 
)
inlinestatic
static std::string DtPerformanceMonitor::ProfileContextString ( int  context)
inlinestatic
virtual void DtPerformanceMonitor::pause ( )
virtual

When paused, will not add samples to the.

See Also
paused()
virtual void DtPerformanceMonitor::resume ( )
virtual
virtual bool DtPerformanceMonitor::isPaused ( ) const
virtual

When paused, will not add samples to the.

virtual void DtPerformanceMonitor::addSample ( double  frameTime,
int  section = -1 
)
virtual

If the frameTime is > 0, it calculates the current frame rate as 1/frameTime. Then it adds this frameTime (either 0 or calculated value) to its averager as another sample point.

Referenced by DtPerformanceMonitorMarker::stop().

virtual void DtPerformanceMonitor::adjustSample ( int  section,
double  frameTime 
)
virtual

Adjusts the sample by the given time.

static DtPerformanceMonitor* DtPerformanceMonitor::Instance ( )
static
static void DtPerformanceMonitor::DeleteInstance ( )
static
static DtPerformanceMonitor* DtPerformanceMonitor::SetInstance ( DtPerformanceMonitor )
static

Sets a new and returns the old performance monitor. If you no longer need the old performance monitor you can delete it.

virtual double DtPerformanceMonitor::meanFrameRate ( int  section = -1)
virtual
virtual double DtPerformanceMonitor::medianFrameRate ( int  section = -1)
virtual
virtual double DtPerformanceMonitor::standardDeviationFrameRate ( int  section = -1)
virtual
virtual double DtPerformanceMonitor::minimumFrameRate ( int  section = -1)
virtual
virtual double DtPerformanceMonitor::maximumFrameRate ( int  section = -1)
virtual
virtual double DtPerformanceMonitor::lastSample ( int  section = -1)
virtual
Returns
The last sample point added.
virtual void DtPerformanceMonitor::reset ( )
virtual

Clear out the array of frame rates and start over.

virtual void DtPerformanceMonitor::setNumberOfFramesToAverage ( unsigned int  numFramesToAverage)
virtual

Can also be set in a frameRateRequestMessage. A zero turns off averaging.

virtual unsigned int DtPerformanceMonitor::numberOfFramesToAverage ( )
virtual
virtual int DtPerformanceMonitor::numSections ( ) const
virtual

Number of sections.

virtual int DtPerformanceMonitor::section ( int  index) const
virtual

The section at the given index. This can be used to get the time for the given section.

virtual std::vector<int> DtPerformanceMonitor::sections ( ) const
virtual

Vector of sections.

const SectionTimes& DtPerformanceMonitor::sectionTimes ( ) const
inline
double DtPerformanceMonitor::currentFrameRate ( ) const
inline

Member Data Documentation

std::map<int, std::string>* DtPerformanceMonitor::theProfileContextStrings
staticprotected
SectionTimes DtPerformanceMonitor::mySectionTimes
protected
bool DtPerformanceMonitor::myIsPaused
protected
double DtPerformanceMonitor::myCurrentFrameRate
protected
DtPerformanceMonitor* DtPerformanceMonitor::thePerformanceMonitor
staticprotected
unsigned int DtPerformanceMonitor::myMaxPopulationSize
protected

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

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)