Skip to content

Commit

Permalink
Review updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
markmandel committed Feb 16, 2024
1 parent a906a36 commit 487f7c1
Show file tree
Hide file tree
Showing 8 changed files with 426 additions and 416 deletions.
4 changes: 2 additions & 2 deletions examples/counterfleetautoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ spec:
# Value can be an absolute number (ex: 5) or a percentage of the Counter available capacity (ex: 5%).
# An absolute number is calculated from percentage by rounding up. Must be bigger than 0. Required field.
bufferSize: 5
# MinCapacity is the minimum aggregate Counter available capacity across the fleet.
# MinCapacity is the minimum aggregate Counter total capacity across the fleet.
# If BufferSize is specified as a percentage, MinCapacity is required and cannot be 0.
# If non zero, MinCapacity must be smaller than MaxCapacity and must be greater than or equal to BufferSize.
minCapacity: 10
# MaxCapacity is the maximum aggregate Counter available capacity across the fleet.
# MaxCapacity is the maximum aggregate Counter total capacity across the fleet.
# MaxCapacity must be greater than or equal to both MinCapacity and BufferSize. Required field.
maxCapacity: 100
4 changes: 2 additions & 2 deletions examples/listfleetautoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ spec:
# It can be specified either as an absolute value (i.e. 5) or percentage format (i.e. 5%).
# Must be bigger than 0. Required field.
bufferSize: 5
# MinCapacity is the minimum aggregate List available capacity across the fleet.
# MinCapacity is the minimum aggregate List total capacity across the fleet.
# If BufferSize is specified as a percentage, MinCapacity is required must be greater than 0.
# If non zero, MinCapacity must be smaller than MaxCapacity and must be greater than or equal to BufferSize.
minCapacity: 10
# MaxCapacity is the maximum aggregate List available capacity across the fleet.
# MaxCapacity is the maximum aggregate List total capacity across the fleet.
# MaxCapacity must be greater than or equal to both MinCapacity and BufferSize. Required field.
maxCapacity: 100
8 changes: 4 additions & 4 deletions pkg/apis/autoscaling/v1/fleetautoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@ type CounterPolicy struct {
// Key is the name of the Counter. Required field.
Key string `json:"key"`

// MaxCapacity is the maximum aggregate Counter available capacity across the fleet.
// MaxCapacity is the maximum aggregate Counter total capacity across the fleet.
// MaxCapacity must be bigger than both MinCapacity and BufferSize. Required field.
MaxCapacity int64 `json:"maxCapacity"`

// MinCapacity is the minimum aggregate Counter available capacity across the fleet.
// MinCapacity is the minimum aggregate Counter total capacity across the fleet.
// If zero, MinCapacity is ignored.
// If non zero, MinCapacity must be smaller than MaxCapacity and bigger than BufferSize.
MinCapacity int64 `json:"minCapacity"`
Expand All @@ -179,11 +179,11 @@ type ListPolicy struct {
// Key is the name of the List. Required field.
Key string `json:"key"`

// MaxCapacity is the maximum aggregate List available capacity across the fleet.
// MaxCapacity is the maximum aggregate List total capacity across the fleet.
// MaxCapacity must be bigger than both MinCapacity and BufferSize. Required field.
MaxCapacity int64 `json:"maxCapacity"`

// MinCapacity is the minimum aggregate List available capacity across the fleet.
// MinCapacity is the minimum aggregate List total capacity across the fleet.
// If zero, it is ignored.
// If non zero, it must be smaller than MaxCapacity and bigger than BufferSize.
MinCapacity int64 `json:"minCapacity"`
Expand Down
4 changes: 2 additions & 2 deletions pkg/fleetautoscalers/fleetautoscalers.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func applyCounterOrListPolicy(c *autoscalingv1.CounterPolicy, l *autoscalingv1.L
bufferSize = l.BufferSize
}

// Checks if we've limited by AVAILABLE capacity
// Checks if we've limited by TOTAL capacity
limited, scale := isLimited(aggCapacity, minCapacity, maxCapacity)

// Total current number of Replicas
Expand All @@ -319,7 +319,7 @@ func applyCounterOrListPolicy(c *autoscalingv1.CounterPolicy, l *autoscalingv1.L
if err != nil {
return 0, false, err
}
// The desired AVAILABLE capacity based on the Aggregated Allocated Counts (see applyBufferPolicy for explanation)
// The desired TOTAL capacity based on the Aggregated Allocated Counts (see applyBufferPolicy for explanation)
desiredCapacity := int64(math.Ceil(float64(aggAllocatedCount*100) / float64(100-bufferPercent)))
// Convert into a desired AVAILABLE capacity aka the buffer
buffer = desiredCapacity - aggAllocatedCount
Expand Down
10 changes: 10 additions & 0 deletions site/content/en/docs/Integration Patterns/player-capacity.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ description: >
Find a `GameServer` that has room for a specific number of players.
---

{{% pageinfo color="info" %}}
[Counters and Lists]({{< ref "/docs/Guides/counters-and-lists.md" >}}) will eventually replace the Alpha functionality
of Player Tracking, which will subsequently be removed from Agones.

If you are currently using this Alpha feature, we would love for you to test (and ideally migrate to!) this new
functionality to Counters and Lists to ensure it meet all your needs.

This document will be updated to utilise Counters and Lists in the near future.
{{% /pageinfo %}}

{{< alpha
title="Player Tracking and Allocation Player Filter"
gate="PlayerTracking,PlayerAllocationFilter" >}}
Expand Down
Loading

0 comments on commit 487f7c1

Please sign in to comment.