1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Add more Prometheus metrics (#12274)

This commit is contained in:
sfan5 2022-05-09 21:20:58 +02:00 committed by GitHub
parent c2898f53bc
commit f5a8593b11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 225 additions and 120 deletions

View file

@ -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;
};