Update metrics

This commit is contained in:
Christoph Hagen 2023-02-01 20:10:57 +01:00
parent d30222911d
commit 13f13c8503

View File

@ -23,8 +23,6 @@ final class TableManagement {
/// The metric describing the number of players currently connected via a websocket
private let connectedPlayerCountMetric: Metric<Int>
/**
Load the tables from a file in the storage folder
- Throws: Errors when the file could not be read
@ -64,10 +62,12 @@ final class TableManagement {
private func logPlayingPlayerCount() {
let count = tables.values.sum { $0.playerCount }
playingPlayerCountMetric.update(count)
}
private func logConnectedPlayerCount() {
let count = tables.values.sum { $0.numberOfConnectedPlayers }
connectedPlayerCountMetric.update(count)
}
/**