![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cTaskProfiler.h>
Public Member Functions | |
cTaskProfiler (TASK_PROFILER_t iQtyTasks) | |
virtual | ~cTaskProfiler () |
bool | isProfilingActive () const |
TIMESECD_t | get_SampleWindowLen () const |
void | put_SampleWindowLen (TIMESECD_t iSampleWindowSec) |
TASK_PROFILER_t | get_TaskQty () const |
TASK_PROFILER_t | get_TaskCurrent () const |
TASK_PROFILER_t | SwitchTask (TASK_PROFILER_t idTask) |
void | IncTaskCount (TASK_PROFILER_t idTask, UINT nSamples, TIMEPERF_t Type=cTaskProfilerRec::k_NOTIME_BYTERATE) |
void | SetTaskCount (TASK_PROFILER_t idTask, UINT nSamples, TIMEPERF_t Type=cTaskProfilerRec::k_NOTIME_COUNT) |
cStringA | GetTaskStatusDesc (TASK_PROFILER_t idTask) const |
float | GetTaskPercent (TASK_PROFILER_t idTask) const |
TIMESECF_t | GetTaskTimeSec (TASK_PROFILER_t idTask) const |
TIMEPERF_t | get_TaskDiff () const |
double | get_TaskDiffSec () const |
virtual void | OnSampleWindowComplete () |
UNITTEST_FRIEND (cTaskProfiler) | |
Public Attributes | |
UINT | m_nSampleFrame |
total number of sample frames. More... | |
Protected Member Functions | |
void | InitTestCurrentWindow () |
void | ClearCurrentWindow () |
cTaskProfilerRec & | GetTaskCur (TASK_PROFILER_t idTask) |
Protected Attributes | |
const TASK_PROFILER_t | m_iTaskQty |
TIMESECD_t | m_iSampleWindowSec |
The sample window size (in seconds). 0=off. More... | |
cTimePerf | m_TimeWindowSize |
same as m_iSampleWindowSec but in cTimePerf units. More... | |
cThreadLockCount | m_LockProf |
make sure we can't conflict this. More... | |
cArrayTyped< cTaskProfilerRec, cTaskProfilerRec & > | m_PrvWindow |
cArrayTyped< cTaskProfilerRec, cTaskProfilerRec & > | m_CurWindow |
cTimePerf | m_TimeTotal |
Total time collected for this sample window. (so far) More... | |
cTaskProfilerThread | m_Cur |
Track an apps transition from Task to Task. Accumulate how much time the app spends in each Task/State.
GrayLib::cTaskProfiler::cTaskProfiler | ( | TASK_PROFILER_t | iQtyTasks | ) |
|
virtual |
|
protected |
|
inline |
|
inline |
What is the current task we are profiling?
|
inline |
How much time has passed for current task?
|
inline |
How much time has passed for current task? TIMESECF_t
|
inline |
|
inlineprotected |
|
inline |
What percent of the CPU is this task using? 1=100%
cStringA GrayLib::cTaskProfiler::GetTaskStatusDesc | ( | TASK_PROFILER_t | idTask | ) | const |
Get Description of a certain task.
|
inline |
What amount of time is this using ? TIMESECF_t seconds.
|
inline |
Not used as a task, just a statistical counter.
|
protected |
|
inline |
|
virtual |
Move to a next/new sample window. If NT we can push these values out to the registry !? override this.
void GrayLib::cTaskProfiler::put_SampleWindowLen | ( | TIMESECD_t | iSampleWindowSec | ) |
Start the timers going. Set the sample window size.
|
inline |
Not used as a task, just a statistical counter.
TASK_PROFILER_t GrayLib::cTaskProfiler::SwitchTask | ( | TASK_PROFILER_t | idTask | ) |
Stop the previous task and start a new one. Accumulate how much time is spent in each task.
GrayLib::cTaskProfiler::UNITTEST_FRIEND | ( | cTaskProfiler | ) |
|
protected |
|
protected |
|
protected |
The sample window size (in seconds). 0=off.
|
protected |
|
mutableprotected |
make sure we can't conflict this.
UINT GrayLib::cTaskProfiler::m_nSampleFrame |
total number of sample frames.
|
protected |
|
protected |
Total time collected for this sample window. (so far)
|
protected |
same as m_iSampleWindowSec but in cTimePerf units.