Skip to content

Commit

Permalink
Add: keep stats about the openttd-version used for listing (#56)
Browse files Browse the repository at this point in the history
This allows us to see how quickly people migrate to a newer version
of OpenTTD.
  • Loading branch information
TrueBrain authored Aug 28, 2021
1 parent 0b11a1f commit d5d69ce
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion game_coordinator/application/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ async def receive_PACKET_COORDINATOR_CLIENT_LISTING(
await source.protocol.send_PACKET_COORDINATOR_GC_LISTING(
protocol_version, game_info_version, servers_match + servers_other, self._newgrf_lookup_table
)
await self.database.stats_listing(game_info_version)
await self.database.stats_listing(game_info_version, openttd_version)

async def receive_PACKET_COORDINATOR_CLIENT_CONNECT(self, source, protocol_version, invite_code):
if not invite_code or invite_code[0] != "+" or invite_code not in self._servers:
Expand Down
3 changes: 2 additions & 1 deletion game_coordinator/database/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,9 @@ async def stats_connect(self, method_name, result, final=True):

await self._stats(key, method_name)

async def stats_listing(self, game_info_version):
async def stats_listing(self, game_info_version, openttd_version):
await self._stats("listing", game_info_version)
await self._stats("listing-version", openttd_version)

async def stats_turn(self, side):
await self._stats("turn", side)
Expand Down
1 change: 1 addition & 0 deletions game_coordinator/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ async def stats_handler(request):
{
"verify": await DB_INSTANCE.get_stats("verify"),
"listing": await DB_INSTANCE.get_stats("listing"),
"listing-version": await DB_INSTANCE.get_stats("listing-version"),
"connect": await DB_INSTANCE.get_stats("connect"),
"connect-failed": await DB_INSTANCE.get_stats("connect-failed"),
"connect-method-failed": await DB_INSTANCE.get_stats("connect-method-failed"),
Expand Down

0 comments on commit d5d69ce

Please sign in to comment.