Export prometheus metrics (#286)

This commit is contained in:
evanpelle
2025-03-18 09:00:05 -07:00
committed by GitHub
parent fe3b4fb8cc
commit 70e348c94b
8 changed files with 208 additions and 1 deletions
+12
View File
@@ -40,6 +40,18 @@ export class GameManager {
return game;
}
activeGames(): number {
return this.games.size;
}
activeClients(): number {
let totalClients = 0;
this.games.forEach((game: GameServer) => {
totalClients += game.activeClients.length;
});
return totalClients;
}
tick() {
const active = new Map<GameID, GameServer>();
for (const [id, game] of this.games) {