aboutsummaryrefslogtreecommitdiff
path: root/src/map.h
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2022-05-09 21:20:58 +0200
committerGitHub <noreply@github.com>2022-05-09 21:20:58 +0200
commitf5a8593b11382b70ee969dc93b71f34fb0cad5df (patch)
treebb3b782a61147b9052bac3de578b808f7abd315f /src/map.h
parentc2898f53bc3eb1f22daf93b37608156885fe5c5a (diff)
downloadhax-minetest-server-f5a8593b11382b70ee969dc93b71f34fb0cad5df.tar.gz
hax-minetest-server-f5a8593b11382b70ee969dc93b71f34fb0cad5df.zip
Add more Prometheus metrics (#12274)
Diffstat (limited to 'src/map.h')
-rw-r--r--src/map.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/map.h b/src/map.h
index 21e3dbd6c..1e5499586 100644
--- a/src/map.h
+++ b/src/map.h
@@ -275,6 +275,9 @@ protected:
// This stores the properties of the nodes on the map.
const NodeDefManager *m_nodedef;
+ // Can be implemented by child class
+ virtual void reportMetrics(u64 save_time_us, u32 saved_blocks, u32 all_blocks) {}
+
bool determineAdditionalOcclusionCheck(const v3s16 &pos_camera,
const core::aabbox3d<s16> &block_bounds, v3s16 &check);
bool isOccluded(const v3s16 &pos_camera, const v3s16 &pos_target,
@@ -392,6 +395,10 @@ public:
MapSettingsManager settings_mgr;
+protected:
+
+ void reportMetrics(u64 save_time_us, u32 saved_blocks, u32 all_blocks) override;
+
private:
friend class LuaVoxelManip;
@@ -420,7 +427,10 @@ private:
MapDatabase *dbase = nullptr;
MapDatabase *dbase_ro = nullptr;
+ // Map metrics
+ MetricGaugePtr m_loaded_blocks_gauge;
MetricCounterPtr m_save_time_counter;
+ MetricCounterPtr m_save_count_counter;
};