VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
makVrv::DtInMemoryProfiler Class Reference

This class measures time difference (cpu time, wall time, etc) between calls to its start and stop function. More...

Public Member Functions

 DtInMemoryProfiler (std::size_t numOfSamples, const std::string &fileName)
 CTOR Max number of samples to be collected must be provided up front, so that mem allocations don't take up profiling time.
 ~DtInMemoryProfiler ()
 DTOR.
std::size_t numSamples (void) const
 Max number of samples that the profiler can profile.
void start ()
 Start profiling (a given frame)
void stop ()
 Stop profiling (a given frame)
void reset ()
 discard current samples profiled (e.g. to start profiling anew)
bool dumped (void) const
 were stats dumped already? This can happen if the number of samples to be collected exceed the capacity
void dump ()
 dump the collected samples to a file
bool valid () const
 Is profiler valid.

Static Public Member Functions

static std::size_t calculateNumberOfSamples (float estimatedFrequency, float estimatedRunTimeSeconds)
 Utility function: Given an approximate frequency and a run time in seconds will compute the upper bound on the number of samples needed.

Private Attributes

std::string myFileName
const std::size_t myNumSamples
std::size_t myCurrentSample
double * mySamples
bool isValid
DtTimedSection * myTimer
std::ofstream myDumpFile
bool myDumped

Detailed Description

This class measures time difference (cpu time, wall time, etc) between calls to its start and stop function.

Constructor & Destructor Documentation

makVrv::DtInMemoryProfiler::DtInMemoryProfiler ( std::size_t  numOfSamples,
const std::string &  fileName 
)

CTOR Max number of samples to be collected must be provided up front, so that mem allocations don't take up profiling time.

makVrv::DtInMemoryProfiler::~DtInMemoryProfiler ( )

DTOR.

Member Function Documentation

static std::size_t makVrv::DtInMemoryProfiler::calculateNumberOfSamples ( float  estimatedFrequency,
float  estimatedRunTimeSeconds 
)
static

Utility function: Given an approximate frequency and a run time in seconds will compute the upper bound on the number of samples needed.

std::size_t makVrv::DtInMemoryProfiler::numSamples ( void  ) const

Max number of samples that the profiler can profile.

void makVrv::DtInMemoryProfiler::start ( )

Start profiling (a given frame)

void makVrv::DtInMemoryProfiler::stop ( )

Stop profiling (a given frame)

void makVrv::DtInMemoryProfiler::reset ( )

discard current samples profiled (e.g. to start profiling anew)

bool makVrv::DtInMemoryProfiler::dumped ( void  ) const

were stats dumped already? This can happen if the number of samples to be collected exceed the capacity

void makVrv::DtInMemoryProfiler::dump ( )

dump the collected samples to a file

bool makVrv::DtInMemoryProfiler::valid ( ) const

Is profiler valid.

Will be false if it cannot allocate memory for requested number of samples or if the dump file cannot be written to, etc

Member Data Documentation

std::string makVrv::DtInMemoryProfiler::myFileName
private
const std::size_t makVrv::DtInMemoryProfiler::myNumSamples
private
std::size_t makVrv::DtInMemoryProfiler::myCurrentSample
private
double* makVrv::DtInMemoryProfiler::mySamples
private
bool makVrv::DtInMemoryProfiler::isValid
private
DtTimedSection* makVrv::DtInMemoryProfiler::myTimer
private
std::ofstream makVrv::DtInMemoryProfiler::myDumpFile
private
bool makVrv::DtInMemoryProfiler::myDumped
private

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

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)