Add desync tracking metrics (#2707)

## Description:

- Added observable gauge to track total number of client desyncs
detected across game servers
- Tracks desyncs at the individual client level (counts each out-of-sync
client)
- Exposes metric as `openfront.desyncs.gauge` for monitoring

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [ ] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
This commit is contained in:
Evan
2025-12-26 16:10:43 -08:00
committed by GitHub
parent 116720bd5d
commit 5dc38d25f0
3 changed files with 21 additions and 3 deletions
+8
View File
@@ -94,6 +94,14 @@ export class GameManager {
return totalClients;
}
desyncCount(): number {
let totalDesyncs = 0;
this.games.forEach((game: GameServer) => {
totalDesyncs += game.desyncCount;
});
return totalDesyncs;
}
tick() {
const active = new Map<GameID, GameServer>();
for (const [id, game] of this.games) {