Add unique and new player metrics (Refs #142)
CI / checks (push) Successful in 4m53s

This commit is contained in:
2026-10-10 18:47:56 -04:00
parent 7fcf1cded2
commit e3e740cea3
16 changed files with 1212 additions and 3 deletions
+12
View File
@@ -18,6 +18,7 @@ const report = (days: number) => ({
summary: totals,
running: { average: null, peak: 0, capturedHours: 0 },
matches: emptyMatches,
players: { uniquePlayers: null, newPlayers: null, historyStartAt: null },
autoscaling: {
added: 0,
removed: 0,
@@ -286,11 +287,22 @@ describe('metrics background refresh', () => {
startAt: 0,
endAt: 1000,
partial: true,
uniquePlayers: 0,
newPlayers: 0,
playerHistoryPartial: false,
capturedHours: 1 / 3600
}
]
};
const invalid = [
{ ...value, players: undefined },
{ ...value, players: { uniquePlayers: 1, newPlayers: 0 } },
...[undefined, -1, 1.5, '2'].map((newPlayers) => ({
...value,
players: { ...value.players, newPlayers }
})),
{ ...value, points: [{ ...value.points[0], uniquePlayers: undefined }] },
{ ...value, points: [{ ...value.points[0], playerHistoryPartial: undefined }] },
{ ...value, maps: [{ ...value.maps[0], running: undefined }] },
{
...value,