25 #ifndef PXR_BASE_TRACE_AGGREGATE_TREE_H 26 #define PXR_BASE_TRACE_AGGREGATE_TREE_H 30 #include "pxr/base/trace/api.h" 31 #include "pxr/base/trace/aggregateNode.h" 33 PXR_NAMESPACE_OPEN_SCOPE
51 using ThisPtr = TraceAggregateTreePtr;
52 using ThisRefPtr = TraceAggregateTreeRefPtr;
55 using EventTimes = std::map<TfToken, TimeStamp>;
56 using CounterMap = TfHashMap<TfToken, double, TfToken::HashFunctor>;
59 static ThisRefPtr
New() {
60 return TfCreateRefPtr(
new This());
64 TraceAggregateNodePtr
GetRoot() {
return _root; }
85 TRACE_API
void Clear();
90 const TraceEventTreeRefPtr& eventTree,
96 using _CounterIndexMap =TfHashMap<TfToken, int, TfToken::HashFunctor>;
98 TraceAggregateNodeRefPtr _root;
99 EventTimes _eventTimes;
100 CounterMap _counters;
101 _CounterIndexMap _counterIndexMap;
104 friend class Trace_AggregateTreeBuilder;
107 PXR_NAMESPACE_CLOSE_SCOPE
109 #endif // PXR_BASE_TRACE_AGGREGATE_TREE_H const CounterMap & GetCounters() const
Returns a map of counters (counter keys), associated with their total accumulated value.
static ThisRefPtr New()
Create an empty tree.
A representation of a call tree.
This class contains a timeline call tree and a map of counters to their values over time.
TraceAggregateNodePtr GetRoot()
Returns the root node of the tree.
uint64_t TimeStamp
Time in "ticks".
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
TRACE_API void Append(const TraceEventTreeRefPtr &eventTree, const TraceCollection &collection)
Creates new nodes and counter data from data in eventTree and collection.
Enable a concrete base class for use with TfRefPtr.
Token for efficient comparison, assignment, and hashing of known strings.
TRACE_API int GetCounterIndex(const TfToken &key) const
Returns the numeric index associated with a counter key.
const EventTimes & GetEventTimes() const
Returns a map of event keys to total inclusive time.
TRACE_API void Clear()
Removes all data and nodes from the tree.
This class owns lists of TraceEvent instances per thread, and allows read access to them.
TRACE_API bool AddCounter(const TfToken &key, int index, double totalValue)
Add a counter to the tree.
Enable a concrete base class for use with TfWeakPtr.