]> git.tdb.fi Git - libs/core.git/blobdiff - source/debug/profiler.h
Make Profiler able to report number of calls per second
[libs/core.git] / source / debug / profiler.h
index 5ec8f3f1fcafa5dae8ebe4508a5b02abaeb7e1f3..ad0653c0697f566b31f356974733293277d6e63b 100644 (file)
@@ -5,6 +5,7 @@
 #include <string>
 #include <vector>
 #include <msp/time/timedelta.h>
+#include <msp/time/timestamp.h>
 
 namespace Msp {
 namespace Debug {
@@ -25,14 +26,23 @@ Profiler for each thread.
 class Profiler
 {
 public:
+       struct CallInfo
+       {
+               Msp::Time::TimeStamp entry_time;
+               Msp::Time::TimeDelta duration;
+       };
+
        struct ScopeInfo
        {
+               Time::TimeStamp first_call;
                unsigned calls;
                Time::TimeDelta total_time;
                Time::TimeDelta self_time;
                Time::TimeDelta avg_time;
-               std::vector<Time::TimeDelta> history;
+               float calls_per_sec;
+               std::vector<CallInfo> history;
                unsigned hist_pos;
+               bool hist_full;
                std::map<std::string, unsigned> called_from;
 
                ScopeInfo();