Ocular Engine
ProfilerNode.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_CORE_PERFORMANCE_PROFILER_NODE__H__
19 #define __H__OCULAR_CORE_PERFORMANCE_PROFILER_NODE__H__
20 
21 #include <string>
22 #include <vector>
23 #include <stdint.h>
24 
25 //------------------------------------------------------------------------------------------
26 
31 namespace Ocular
32 {
37  namespace Core
38  {
40  {
41  public:
42 
43  ProfilerNode(ProfilerNode* parent, std::string const& name, std::string const& segment);
44  ~ProfilerNode();
45 
46  bool operator==(ProfilerNode const* rhs);
47 
48  //------------------------------------------------------------
49  // Variables
50 
51  std::string name;
52  std::string segment;
53 
54  uint32_t totalCalls;
55  uint32_t blockDepth;
56  uint32_t recursiveDepth;
57 
58  uint64_t blockStart;
59  uint64_t localElapsed;
60  uint64_t totalElapsed;
61 
63  std::vector<ProfilerNode*> children;
64 
65  protected:
66 
67  private:
68  };
69  }
73 }
78 //------------------------------------------------------------------------------------------
79 
80 #endif
uint32_t totalCalls
Total amount of times this node has been profiled.
Definition: ProfilerNode.hpp:54
uint32_t recursiveDepth
If in a recursive function, the current depth.
Definition: ProfilerNode.hpp:56
std::string name
Name of this node (fully qualified method/function name)
Definition: ProfilerNode.hpp:51
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
ProfilerNode * parent
Parent node (null if root)
Definition: ProfilerNode.hpp:62
std::string segment
Segment name of this node.
Definition: ProfilerNode.hpp:52
uint32_t blockDepth
Depth of the block (used for printing)
Definition: ProfilerNode.hpp:55
std::vector< ProfilerNode * > children
Children nodes.
Definition: ProfilerNode.hpp:63
uint64_t totalElapsed
Total amount of time elapsed.
Definition: ProfilerNode.hpp:60
uint64_t localElapsed
Amount of time elapsed in the local block.
Definition: ProfilerNode.hpp:59
uint64_t blockStart
Start time (ns) of the latest block.
Definition: ProfilerNode.hpp:58
Definition: ProfilerNode.hpp:39