diff options
Diffstat (limited to 'src/emerge.h')
-rw-r--r-- | src/emerge.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/emerge.h b/src/emerge.h index 61e7bda63..1bac4b708 100644 --- a/src/emerge.h +++ b/src/emerge.h @@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "network/networkprotocol.h" #include "irr_v3d.h" #include "util/container.h" +#include "util/metricsbackend.h" #include "mapgen/mapgen.h" // for MapgenParams #include "map.h" @@ -69,6 +70,14 @@ enum EmergeAction { EMERGE_GENERATED, }; +const static std::string emergeActionStrs[] = { + "cancelled", + "errored", + "from_memory", + "from_disk", + "generated", +}; + // Callback typedef void (*EmergeCompletionCallback)( v3s16 blockpos, EmergeAction action, void *param); @@ -138,7 +147,7 @@ public: MapSettingsManager *map_settings_mgr; // Methods - EmergeManager(Server *server); + EmergeManager(Server *server, MetricsBackend *mb); ~EmergeManager(); DISABLE_CLASS_COPY(EmergeManager); @@ -197,6 +206,9 @@ private: u32 m_qlimit_diskonly; u32 m_qlimit_generate; + // Emerge metrics + MetricCounterPtr m_completed_emerge_counter[5]; + // Managers of various map generation-related components // Note that each Mapgen gets a copy(!) of these to work with BiomeGen *biomegen; @@ -218,5 +230,7 @@ private: bool popBlockEmergeData(v3s16 pos, BlockEmergeData *bedata); + void reportCompletedEmerge(EmergeAction action); + friend class EmergeThread; }; |