diff options
author | Elias Fleckenstein <54945686+EliasFleckenstein03@users.noreply.github.com> | 2020-11-04 16:57:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-04 16:57:47 +0100 |
commit | 3e16c3a78fff61c20e63ba730d15e94e3bb877b4 (patch) | |
tree | c070350db219f2c4241d22bc31949685c7b42fe9 /src/profiler.h | |
parent | 5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc (diff) | |
parent | 6ccb5835ff55d85156be91473c598eca9d6cb9a6 (diff) | |
download | dragonfireclient-3e16c3a78fff61c20e63ba730d15e94e3bb877b4.tar.xz |
Merge branch 'master' into master
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; |