This class, along with the PPROFILE_TIMESCOPE() macro, allows the measurement of the time used by a section of code delimited by the scope (block till the close brace) with minimum, maximum and averages displayed as a PTRACE().
More...
#include <object.h>
This class, along with the PPROFILE_TIMESCOPE() macro, allows the measurement of the time used by a section of code delimited by the scope (block till the close brace) with minimum, maximum and averages displayed as a PTRACE().
PProfiling::TimeScope::TimeScope |
( |
const PDebugLocation & |
location, |
|
|
unsigned |
thresholdTime, |
|
|
unsigned |
throttleTime = 10000 , |
|
|
unsigned |
throttledLogLevel = 2 , |
|
|
unsigned |
unthrottledLogLevel = 6 , |
|
|
unsigned |
thresholdPercent = 5 , |
|
|
unsigned |
maxHistory = 0 |
|
) |
| |
Create a TimeScope instance.
This is usually created as a static variable by the PPROFILE_TIMESCOPE() macro.
- Parameters
-
location | Source location, typically from macro P_DEBUG_LOCATION |
thresholdTime | Threshold time in milliseconds |
throttleTime | Time between PTRACE output in milliseconds |
throttledLogLevel | PTRACE level to use if enough samples are above thresholdTime |
unthrottledLogLevel | PTRACE level to use otherwise |
thresholdPercent | Percentage of samples above thresholdTime to trigger throttledLogLevel |
maxHistory | Optional number of samples above thresholdTime to display sincle last PTRACE() |
PProfiling::TimeScope::TimeScope |
( |
const TimeScope & |
other | ) |
|
PProfiling::TimeScope::~TimeScope |
( |
| ) |
|
void PProfiling::TimeScope::EndMeasurement |
( |
const void * |
context, |
|
|
const PObject * |
object, |
|
|
const PDebugLocation * |
location, |
|
|
uint64_t |
startTime |
|
) |
| |
End and process a measurement period.
const PTimeInterval& PProfiling::TimeScope::GetLastDuration |
( |
| ) |
const |
void PProfiling::TimeScope::SetMaxHistory |
( |
unsigned |
maxHistory | ) |
|
Set optional number of samples above thresholdTime to display sincle last PTRACE()
void PProfiling::TimeScope::SetThresholdPercent |
( |
unsigned |
thresholdPercent | ) |
|
Set Percentage of samples above thresholdTime to trigger throttledLogLevel.
void PProfiling::TimeScope::SetThrottledLogLevel |
( |
unsigned |
throttledLogLevel | ) |
|
Set PTRACE level to use if enough samples are above thresholdTime.
void PProfiling::TimeScope::SetThrottleTime |
( |
unsigned |
throttleTime | ) |
|
Set time between PTRACE output in milliseconds.
void PProfiling::TimeScope::SetUnthrottledLogLevel |
( |
unsigned |
unthrottledLogLevel | ) |
|
Set PTRACE level to use otherwise.
Implementation* const PProfiling::TimeScope::m_implementation |
|
protected |
The documentation for this class was generated from the following file: