Candy
|
TimeStatistics is a tool for measuring frame rates in different threads, thread contention and algorithm delay. More...
Public Member Functions | |
TimeStatistics (H3D::Inst< H3D::SFNode > _metadata=0, H3D::Inst< H3D::MFString > _identifier=0, H3D::Inst< H3D::MFFloat > _secondsPerTick=0, H3D::Inst< H3D::MFFloat > _ticksPerSecond=0, H3D::Inst< H3D::MFFloat > _fractionTicktock=0, H3D::Inst< H3D::SFFloat > _statisticsWindow=0, H3D::Inst< H3D::SFString > _tickIdentifier=0, H3D::Inst< H3D::SFString > _tockIdentifier=0, H3D::Inst< TickField > _tickField=0, H3D::Inst< TockField > _tockField=0) | |
void | traverseSG (H3D::TraverseInfo &ti) |
Static Public Member Functions | |
static void | tick (void *ptr, const std::string &identifier) |
Call this function to get a measure of how often the part of the code is reached. More... | |
static void | tock (void *ptr, const std::string &identifier) |
Call this function after a tick to get a measure of how much of the time between two ticks is spent between a tick and a tock. More... | |
static void | getData (std::vector< std::string > &identifiers, std::vector< float > &timePerTick, std::vector< float > &fractionTicktock) |
Esimates and returns the time statistics. More... | |
Public Attributes | |
std::auto_ptr< H3D::MFString > | identifier |
![]() | |
std::auto_ptr< H3D::MFFloat > | secondsPerTick |
![]() | |
std::auto_ptr< H3D::MFFloat > | ticksPerSecond |
![]() | |
std::auto_ptr< H3D::MFFloat > | fractionTicktock |
![]() | |
std::auto_ptr< H3D::SFFloat > | statisticsWindow |
![]() | |
std::auto_ptr< H3D::SFString > | tickIdentifier |
![]() | |
std::auto_ptr< H3D::SFString > | tockIdentifier |
![]() | |
Static Public Attributes | |
static H3D::H3DNodeDatabase | database |
TimeStatistics is a tool for measuring frame rates in different threads, thread contention and algorithm delay.
It is thread safe and called through static functions, and the actual data are estimated upon every call to traverseSG.
|
inlinestatic |
Esimates and returns the time statistics.
The data are cached and updated only if a call to tick or tock has been made since the last call.
|
inlinestatic |
Call this function to get a measure of how often the part of the code is reached.
Use each identifier only once to get an accurate result. The 'this' pointer should be provided as a means to differentiate between calls made from different instances of the same code.
|
inlinestatic |
Call this function after a tick to get a measure of how much of the time between two ticks is spent between a tick and a tock.
Use each identifier only once to get an accurate result. The 'this' pointer should be provided as a means to differentiate between calls made from different instances of the same code.
std::auto_ptr<H3D::MFFloat> Candy::TimeStatistics::fractionTicktock |
The fraction of the total time between a tick and the next tick that is spent between the tick and the tock.
If tick and tock surrounds a computationally heavy algorithm, this measure tells how much of the frame-time that is spent by that algorithm.
std::auto_ptr<H3D::MFString> Candy::TimeStatistics::identifier |
The key used to identify each time statistics.
std::auto_ptr<H3D::MFFloat> Candy::TimeStatistics::secondsPerTick |
The time elapsed between ticks, expressed in seconds.
This value is averaged over the specified window.
std::auto_ptr<H3D::SFFloat> Candy::TimeStatistics::statisticsWindow |
The window over which the statistics are averaged, expressed in seconds.
The default value is one second.
std::auto_ptr<H3D::SFString> Candy::TimeStatistics::tickIdentifier |
This field is connected to the tick function.
See ::tick for more information.
std::auto_ptr<H3D::MFFloat> Candy::TimeStatistics::ticksPerSecond |
The number of ticks per second, estimated as one over the secondsPerTick value.
std::auto_ptr<H3D::SFString> Candy::TimeStatistics::tockIdentifier |
This field is connected to the tock function.
See ::tock for more information.