25 #ifndef PXR_BASE_TRACE_EVENT_TREE_H
26 #define PXR_BASE_TRACE_EVENT_TREE_H
43 #include <unordered_map>
60 using CounterValues = std::vector<std::pair<TraceEvent::TimeStamp, double>>;
62 std::unordered_map<TfToken, CounterValues, TfToken::HashFunctor>;
64 std::unordered_map<TfToken, double, TfToken::HashFunctor>;
66 using MarkerValues = std::vector<std::pair<TraceEvent::TimeStamp, TraceThreadId>>;
68 std::unordered_map<TfToken, MarkerValues, TfToken::HashFunctor>;
74 const CounterMap* initialCounterValues =
nullptr);
76 static TraceEventTreeRefPtr
New() {
81 static TraceEventTreeRefPtr
New(
82 TraceEventNodeRefPtr root,
86 new TraceEventTree(root, std::move(counters), std::move(markers)));
90 const TraceEventNodeRefPtr&
GetRoot()
const {
return _root; }
121 , _counters(std::move(counters))
122 , _markers(std::move(markers)) {}
125 TraceEventNodeRefPtr _root;
134 #endif // PXR_BASE_TRACE_EVENT_TREE_H
TfRefPtr< T > TfCreateRefPtr(T *ptr)
TRACE_API TraceEventTreeRefPtr Add(const TraceCollection &collection)
Adds the data from collection to this tree.
std::unordered_map< TfToken, CounterValues, TfToken::HashFunctor > CounterValuesMap
const MarkerValuesMap & GetMarkers() const
Returns the map of markers values.
std::unordered_map< TfToken, double, TfToken::HashFunctor > CounterMap
static TraceEventTreeRefPtr New()
std::function< void(JsWriter &)> ExtraFieldFn
CounterMap GetFinalCounterValues() const
Return the final value of the counters in the report.
std::unordered_map< TfToken, MarkerValues, TfToken::HashFunctor > MarkerValuesMap
const TraceEventNodeRefPtr & GetRoot() const
Returns the root node of the tree.
static TraceEventNodeRefPtr New()
TRACE_API void Merge(const TraceEventTreeRefPtr &tree)
Adds the contexts of tree to this tree.
TRACE_API void WriteChromeTraceObject(JsWriter &writer, ExtraFieldFn extraFields=ExtraFieldFn()) const
const CounterValuesMap & GetCounters() const
Returns the map of counter values.
static TraceEventTreeRefPtr New(TraceEventNodeRefPtr root, CounterValuesMap counters, MarkerValuesMap markers)
std::vector< std::pair< TraceEvent::TimeStamp, TraceThreadId >> MarkerValues
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE
std::vector< std::pair< TraceEvent::TimeStamp, double >> CounterValues
TF_DECLARE_WEAK_AND_REF_PTRS(TraceEventTree)