diff options
Diffstat (limited to 'src/profiler.h')
-rw-r--r-- | src/profiler.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/profiler.h b/src/profiler.h index a68043d2a..b4a0657f9 100644 --- a/src/profiler.h +++ b/src/profiler.h @@ -27,7 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "threading/mutex_auto_lock.h" #include "util/timetaker.h" -#include "util/numeric.h" // paging() +#include "util/numeric.h" // paging() // Global profiler class Profiler; @@ -56,11 +56,13 @@ public: int print(std::ostream &o, u32 page = 1, u32 pagecount = 1); void getPage(GraphValues &o, u32 page, u32 pagecount); + void graphAdd(const std::string &id, float value) { MutexAutoLock lock(m_mutex); - std::map<std::string, float>::iterator i = m_graphvalues.find(id); - if (i == m_graphvalues.end()) + std::map<std::string, float>::iterator i = + m_graphvalues.find(id); + if(i == m_graphvalues.end()) m_graphvalues[id] = value; else i->second += value; @@ -72,7 +74,7 @@ public: m_graphvalues.clear(); } - void remove(const std::string &name) + void remove(const std::string& name) { MutexAutoLock lock(m_mutex); m_avgcounts.erase(name); @@ -87,8 +89,7 @@ private: u64 m_start_time; }; -enum ScopeProfilerType -{ +enum ScopeProfilerType{ SPT_ADD, SPT_AVG, SPT_GRAPH_ADD @@ -100,7 +101,6 @@ public: ScopeProfiler(Profiler *profiler, const std::string &name, ScopeProfilerType type = SPT_ADD); ~ScopeProfiler(); - private: Profiler *m_profiler = nullptr; std::string m_name; |