projects
/
oweals
/
minetest.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use configured bind_address for HTTPFetch
[oweals/minetest.git]
/
src
/
profiler.h
diff --git
a/src/profiler.h
b/src/profiler.h
index 271ad70c1f1947c0b03dfd575b7ce656a1cb592f..25d89c6c8a6304fd77988ab50fc01189c0f5c5b3 100644
(file)
--- a/
src/profiler.h
+++ b/
src/profiler.h
@@
-20,13
+20,15
@@
with this program; if not, write to the Free Software Foundation, Inc.,
#ifndef PROFILER_HEADER
#define PROFILER_HEADER
#ifndef PROFILER_HEADER
#define PROFILER_HEADER
-#include "irrlichttypes
_bloated
.h"
+#include "irrlichttypes.h"
#include <string>
#include <string>
-#include <jmutex.h>
-#include <jmutexautolock.h>
#include <map>
#include <map>
+
+#include "jthread/jmutex.h"
+#include "jthread/jmutexautolock.h"
#include "util/timetaker.h"
#include "util/numeric.h" // paging()
#include "util/timetaker.h"
#include "util/numeric.h" // paging()
+#include "debug.h" // assert()
/*
Time profiler
/*
Time profiler
@@
-37,7
+39,6
@@
class Profiler
public:
Profiler()
{
public:
Profiler()
{
- m_mutex.Init();
}
void add(const std::string &name, float value)
}
void add(const std::string &name, float value)
@@
-73,7
+74,7
@@
public:
else{
/* No add shall have been used */
assert(n->second != -2);
else{
/* No add shall have been used */
assert(n->second != -2);
- n->second =
(std::max)
(n->second, 0) + 1;
+ n->second =
MYMAX
(n->second, 0) + 1;
}
}
{
}
}
{
@@
-164,6
+165,13
@@
public:
m_graphvalues.clear();
}
m_graphvalues.clear();
}
+ void remove(const std::string& name)
+ {
+ JMutexAutoLock lock(m_mutex);
+ m_avgcounts.erase(name);
+ m_data.erase(name);
+ }
+
private:
JMutex m_mutex;
std::map<std::string, float> m_data;
private:
JMutex m_mutex;
std::map<std::string, float> m_data;