summaryrefslogtreecommitdiff
path: root/src/serverenvironment.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/serverenvironment.h')
-rw-r--r--src/serverenvironment.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/serverenvironment.h b/src/serverenvironment.h
index 8733c2dd2..5dc329a60 100644
--- a/src/serverenvironment.h
+++ b/src/serverenvironment.h
@@ -25,6 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "settings.h"
#include "server/activeobjectmgr.h"
#include "util/numeric.h"
+#include "util/metricsbackend.h"
#include <set>
#include <random>
@@ -167,19 +168,21 @@ public:
std::set<v3s16> &blocks_removed,
std::set<v3s16> &blocks_added);
- bool contains(v3s16 p){
+ bool contains(v3s16 p) const {
return (m_list.find(p) != m_list.end());
}
- void clear(){
+ auto size() const {
+ return m_list.size();
+ }
+
+ void clear() {
m_list.clear();
}
std::set<v3s16> m_list;
std::set<v3s16> m_abm_list;
std::set<v3s16> m_forceloaded_list;
-
-private:
};
/*
@@ -198,7 +201,7 @@ class ServerEnvironment : public Environment
{
public:
ServerEnvironment(ServerMap *map, ServerScripting *scriptIface,
- Server *server, const std::string &path_world);
+ Server *server, const std::string &path_world, MetricsBackend *mb);
~ServerEnvironment();
Map & getMap();
@@ -487,5 +490,10 @@ private:
std::unordered_map<u32, float> m_particle_spawners;
std::unordered_map<u32, u16> m_particle_spawner_attachments;
+ // Environment metrics
+ MetricCounterPtr m_step_time_counter;
+ MetricGaugePtr m_active_block_gauge;
+ MetricGaugePtr m_active_object_gauge;
+
ServerActiveObject* createSAO(ActiveObjectType type, v3f pos, const std::string &data);
};