15std::chrono::steady_clock::duration
21std::chrono::steady_clock::duration
29std::chrono::steady_clock::duration
32 std::chrono::steady_clock::duration children_time(0);
35 children_time += child_it.second->totalTime();
49 long int children_memory = 0;
52 children_memory += child_it.second->totalMemory();
54 return children_memory;
58dataStore(std::ostream & stream,
const std::unique_ptr<PerfNode> & node,
void *)
64 dataStore(stream, node->_total_time,
nullptr);
65 dataStore(stream, node->_num_calls,
nullptr);
66 dataStore(stream, node->_total_memory,
nullptr);
69 std::size_t num_children = node->children().size();
71 for (
auto & id_child_pair : node->_children)
73 const auto & child = id_child_pair.second;
79dataLoad(std::istream & stream,
const std::unique_ptr<PerfNode> & node,
void * perf_graph)
87 std::chrono::steady_clock::duration total_time;
88 dataLoad(stream, total_time,
nullptr);
89 node->_total_time += total_time;
91 long unsigned int num_calls;
92 dataLoad(stream, num_calls,
nullptr);
93 node->_num_calls += num_calls;
95 long unsigned int total_memory;
96 dataLoad(stream, total_memory,
nullptr);
97 node->_total_memory += total_memory;
102 std::size_t num_children;
103 dataLoad(stream, num_children,
nullptr);
105 while (i++ < num_children)
111 const auto & child = node->_children[id];
112 dataLoad(stream, child, perf_graph);
void dataLoad(std::istream &stream, const std::unique_ptr< PerfNode > &node, void *perf_graph)
void dataStore(std::ostream &stream, const std::unique_ptr< PerfNode > &node, void *)
The PerfGraph will hold the master list of all registered performance segments and the head PerfNode.
const PerfNode & rootNode() const
std::chrono::steady_clock::duration totalTime() const
The time this Node plus all of it's children took.
std::chrono::steady_clock::duration childrenTime() const
Get the time this nodes children took.
long int selfMemory() const
Get the amount of memory added by this node.
long int childrenMemory() const
Get the amount of memory added by this node.
std::map< PerfID, std::unique_ptr< PerfNode > > _children
Timers that are directly underneath this node.
long unsigned int _total_memory
The total memory added while this node is active.
std::chrono::steady_clock::duration _total_time
The total elapsed time for this node.
std::chrono::steady_clock::duration selfTime() const
Get the time this node took.
PerfID sectionID(const std::string §ion_name) const
Given a name return the PerfID @section_name The name of the section.
const PerfGraphSectionInfo & sectionInfo(const PerfID section_id) const
Given a PerfID return the PerfGraphSectionInfo @section_id The ID.
std::string _name
The name.
PerfGraphRegistry & getPerfGraphRegistry()
Get the global PerfGraphRegistry singleton.