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.
|
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 |
( |
| ) |
|
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: