From f5a8593b11382b70ee969dc93b71f34fb0cad5df Mon Sep 17 00:00:00 2001 From: sfan5 Date: Mon, 9 May 2022 21:20:58 +0200 Subject: Add more Prometheus metrics (#12274) --- src/map.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/map.h') 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 &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; }; -- cgit v1.2.3