Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add occupied slots to game rooms api (#641) #651

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

reinaldooli
Copy link
Collaborator

This PR implements the changes necessary for Maestro to manage multiple matches per Game Server (pod).

Motivation

Improved Server Utilization: Previously, Maestro treated Game Servers as a single unity of allocation, which was inefficient for games capable of running multiple matches concurrently, as they must implement their own logic to properly send to Maestro the Game Server state (occupied and ready).

Flexible Scaling: By introducing slot-based management, Maestro can better match server scaling to the actual workload, reducing the over-provisioning and improving cost efficiency.

Backward Compatibility: These changes ensure that existing configurations remain unaffected (e.g., default MaxMatches=1), allowing game teams to adopt the new functionality at their own pace.

Key Changes

Scheduler Configuration

  • Added the MatchAllocation block with one parameter:
    • MaxMatches: Defines the maximum number of matches a Game Server can handle;

New gameServer State:

  • Active: Servers hosting matches but not at full capacity.

Logic Updates

  • Autoscaling calculations now account for the number of occupied slots, ensuring more precise scaling decisions;
  • Active state is managed only for Scheduler with MaxMatches > 1

* feat: add occupied slots to game rooms api
* fix: rename api parameter
* fix: failing tests
* chore: upgrade and remove some dependencies (#644)
* chore: upgrade and remove some dependecies
* feat: allow maestro to deal with multiple matches per game server (#646)
* feat: allow maestro to deaul with multiple matches per game server
* fix: removing cooling status
* feat: add new metrics (#649)
* feat: add new metrics
* fix: metrics reporter tests
* fix: protobuf linter offenses
* fix: update buf dependencies before running linter
* fix: add max validation to minFreeSlots fields
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 45.64184% with 343 lines in your changes missing coverage. Please review.

Project coverage is 62.02%. Comparing base (bb118c8) to head (7b1f7db).
Report is 26 commits behind head on main.

Files with missing lines Patch % Lines
pkg/api/v1/messages.pb.go 31.03% 137 Missing and 3 partials ⚠️
pkg/api/v1/schedulers.pb.go 41.37% 51 Missing ⚠️
pkg/api/v1/rooms.pb.go 35.71% 36 Missing ⚠️
pkg/api/v1/schedulers_grpc.pb.go 0.00% 21 Missing ⚠️
pkg/api/v1/operations.pb.go 23.07% 20 Missing ⚠️
pkg/api/v1/rooms_grpc.pb.go 0.00% 13 Missing ⚠️
internal/core/services/rooms/status.go 60.71% 7 Missing and 4 partials ⚠️
pkg/api/v1/rooms.pb.gw.go 0.00% 8 Missing and 3 partials ⚠️
pkg/api/v1/schedulers.pb.gw.go 9.09% 7 Missing and 3 partials ⚠️
pkg/api/v1/operations_grpc.pb.go 0.00% 9 Missing ⚠️
... and 9 more

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #651      +/-   ##
==========================================
- Coverage   64.30%   62.02%   -2.28%     
==========================================
  Files          39      141     +102     
  Lines        2905    12111    +9206     
==========================================
+ Hits         1868     7512    +5644     
- Misses        909     4281    +3372     
- Partials      128      318     +190     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants