HDK
|
#include <collector.h>
Classes | |
struct | DefaultCategory |
Public Types | |
using | This = TraceCollector |
using | ThisPtr = TraceCollectorPtr |
using | TimeStamp = TraceEvent::TimeStamp |
using | Key = TraceDynamicKey |
Public Member Functions | |
TF_MALLOC_TAG_NEW ("Trace","TraceCollector") | |
TRACE_API | ~TraceCollector () |
TRACE_API void | SetEnabled (bool isEnabled) |
Enables or disables collection of events for DefaultCategory. More... | |
TRACE_API TimeStamp | GetScopeOverhead () const |
Return the overhead cost to measure a scope. More... | |
TRACE_API void | Clear () |
const std::string & | GetLabel () |
Return the label associated with this collector. More... | |
TRACE_API void | CreateCollection () |
Public Member Functions inherited from TfWeakBase | |
TfWeakBase () | |
TfWeakBase (const TfWeakBase &) | |
const TfWeakBase & | __GetTfWeakBase__ () const |
const TfWeakBase & | operator= (const TfWeakBase &) |
void | EnableNotification2 () const |
TF_API void const * | GetUniqueIdentifier () const |
Static Public Member Functions | |
static TRACE_API TraceCollector & | GetInstance () |
Returns the singleton instance. More... | |
static bool | IsEnabled () |
Returns whether collection of events is enabled for DefaultCategory. More... | |
Friends | |
class | TfSingleton< TraceCollector > |
Event Recording | |
template<typename Category = DefaultCategory> | |
TimeStamp | BeginEvent (const Key &key) |
template<typename Category = DefaultCategory> | |
void | BeginEventAtTime (const Key &key, double ms) |
template<typename Category = DefaultCategory> | |
TimeStamp | EndEvent (const Key &key) |
template<typename Category = DefaultCategory> | |
void | EndEventAtTime (const Key &key, double ms) |
template<typename Category = DefaultCategory> | |
TimeStamp | MarkerEvent (const Key &key) |
template<typename Category = DefaultCategory> | |
void | MarkerEventAtTime (const Key &key, double ms) |
template<typename Category = DefaultCategory> | |
void | BeginScope (const TraceKey &_key) |
template<typename Category , typename... Args> | |
void | BeginScope (const TraceKey &key, Args &&...args) |
template<typename... Args> | |
void | BeginScope (const TraceKey &key, Args &&...args) |
template<typename Category = DefaultCategory> | |
void | EndScope (const TraceKey &key) |
template<typename Category = DefaultCategory> | |
void | Scope (const TraceKey &key, TimeStamp start, TimeStamp stop) |
template<typename Category , typename... Args> | |
void | ScopeArgs (Args &&...args) |
template<typename... Args> | |
void | ScopeArgs (Args &&...args) |
template<typename Category = DefaultCategory> | |
void | MarkerEventStatic (const TraceKey &key) |
template<typename Category = DefaultCategory, typename T > | |
void | StoreData (const TraceKey &key, const T &value) |
template<typename Category = DefaultCategory> | |
void | RecordCounterDelta (const TraceKey &key, double delta) |
Record a counter delta for a name key if Category is enabled. More... | |
template<typename Category = DefaultCategory> | |
void | RecordCounterDelta (const Key &key, double delta) |
Record a counter delta for a name key if Category is enabled. More... | |
template<typename Category = DefaultCategory> | |
void | RecordCounterValue (const TraceKey &key, double value) |
Record a counter value for a name key if Category is enabled. More... | |
template<typename Category = DefaultCategory> | |
void | RecordCounterValue (const Key &key, double value) |
static TRACE_API void | Scope (const TraceKey &key, TimeStamp start, TimeStamp stop) noexcept |
Additional Inherited Members | |
Protected Member Functions inherited from TfWeakBase | |
~TfWeakBase () | |
TfRefPtr< Tf_Remnant > | _Register () const |
template<class T > | |
TfRefPtr< Tf_Remnant > | _Register (T *tempRmnt) const |
bool | _HasRemnant () const |
This is a singleton class that records TraceEvent instances and populates TraceCollection instances.
All public methods of TraceCollector are safe to call from any thread.
Definition at line 71 of file collector.h.
using TraceCollector::Key = TraceDynamicKey |
Definition at line 81 of file collector.h.
using TraceCollector::This = TraceCollector |
Definition at line 76 of file collector.h.
using TraceCollector::ThisPtr = TraceCollectorPtr |
Definition at line 77 of file collector.h.
Definition at line 79 of file collector.h.
TRACE_API TraceCollector::~TraceCollector | ( | ) |
|
inline |
Record a begin event with key if Category
is enabled. A matching end event is expected some time in the future.
If the key is known at compile time BeginScope
and Scope
methods are preferred because they have lower overhead.
Definition at line 136 of file collector.h.
|
inline |
Record a begin event with key at a specified time if Category
is enabled. This version of the method allows the passing of a specific number of elapsed milliseconds, ms, to use for this event. This method is used for testing and debugging code.
Definition at line 149 of file collector.h.
|
inline |
Record a begin event for a scope described by key if Category
is enabled. It is more efficient to use the Scope
method than to call both BeginScope
and EndScope
.
Definition at line 217 of file collector.h.
Clear all pending events from the collector. No TraceCollection will be made for these events.
Produces a TraceCollection from all the events that recorded in the collector and issues a TraceCollectionAvailable notice. Note that creating a collection restarts tracing, i.e. events contained in this collection will not be present in subsequent collections.
|
inline |
Record an end event with key if Category
is enabled. A matching begin event must have preceded this end event.
If the key is known at compile time EndScope and Scope methods are preferred because they have lower overhead.
Definition at line 165 of file collector.h.
|
inline |
Record an end event with key at a specified time if Category
is enabled. This version of the method allows the passing of a specific number of elapsed milliseconds, ms, to use for this event. This method is used for testing and debugging code.
Definition at line 178 of file collector.h.
|
inline |
Record an end event described by key if Category
is enabled. It is more efficient to use the Scope
method than to call both BeginScope
and EndScope
.
Definition at line 263 of file collector.h.
|
inlinestatic |
Returns the singleton instance.
Definition at line 84 of file collector.h.
|
inline |
Return the label associated with this collector.
Definition at line 398 of file collector.h.
Return the overhead cost to measure a scope.
|
inlinestatic |
Returns whether collection of events is enabled for DefaultCategory.
Definition at line 94 of file collector.h.
|
inline |
Record a marker event with key if Category
is enabled. Unlike begin/end, there is no matching event for marker events
Definition at line 191 of file collector.h.
|
inline |
Record a marker event with key at a specified time if Category
is enabled. This version of the method allows the passing of a specific number of elapsed milliseconds, ms, to use for this event. This method is used for testing and debugging code.
Definition at line 204 of file collector.h.
|
inline |
Record a scope event described by key that started at start if Category
is enabled.
This method is used by the TRACE_FUNCTION, TRACE_SCOPE and TRACE_FUNCTION_SCOPE macros.
Definition at line 332 of file collector.h.
|
inline |
Record a counter delta for a name key if Category
is enabled.
Definition at line 354 of file collector.h.
|
inline |
Record a counter delta for a name key if Category
is enabled.
Definition at line 366 of file collector.h.
|
inline |
Record a counter value for a name key if Category
is enabled.
Definition at line 375 of file collector.h.
|
inline |
Record a counter value for a name key and delta value if Category
is enabled.
Definition at line 387 of file collector.h.
|
staticnoexcept |
Record a scope event described by key that started at start for the DefaultCategory.
This method is used by the TRACE_FUNCTION, TRACE_SCOPE and TRACE_FUNCTION_SCOPE macros.
|
inline |
Record a scope event described by key that started at start if Category
is enabled.
This method is used by the TRACE_FUNCTION, TRACE_SCOPE and TRACE_FUNCTION_SCOPE macros.
Definition at line 287 of file collector.h.
|
inline |
Record multiple data events with category cat if Category
is enabled.
Definition at line 299 of file collector.h.
|
inline |
Record multiple data events with the default category if collection of events is enabled. The variadic arguments args must be an even number of parameters in the form TraceKey, Value. It is more efficient to use this method to store multiple data items than to use multiple calls to StoreData
.
Definition at line 317 of file collector.h.
Enables or disables collection of events for DefaultCategory.
|
inline |
Record a data event with the given key and value if Category
is enabled. value may be of any type which a TraceEvent can be constructed from (bool, int, std::string, uint64, double).
Definition at line 346 of file collector.h.
TraceCollector::TF_MALLOC_TAG_NEW | ( | "Trace" | , |
"TraceCollector" | |||
) |
|
friend |
Definition at line 412 of file collector.h.