Skip to content

Refactor AllocationCounter to GameServerCounter - #639

Merged
markmandel merged 1 commit into
agones-dev:masterfrom
markmandel:refactor/gameservercount
Mar 11, 2019
Merged

markmandel merged 1 commit into
agones-dev:masterfrom
markmandel:refactor/gameservercount

Conversation

@markmandel

Copy link
Copy Markdown
Member

Precursor to #638 - this moves the AllocationCounter code to a more central GameServerCounter (which I think is a better name) that tracks the number of Ready and Allocated GameServers that are
available on each node.

These details are useful for sorting for Packed scheduling strategies.

Once this PR is completed, we can use this Count() values provided by this controller in the GameServerSet scale down logic, to ensure that GameServers on the least used nodes are removed first when using a Packed strategy.

@markmandel markmandel added the kind/cleanup Refactoring code, fixing up documentation, etc label Mar 7, 2019
@markmandel markmandel added this to the 0.9.0 milestone Mar 7, 2019
@markmandel
markmandel requested a review from jkowalski March 7, 2019 00:49
@agones-bot

Copy link
Copy Markdown
Collaborator

Build Succeeded 👏

Build Id: 72d09add-848a-421e-8bb5-103beabc7d07

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/639/head:pr_639 && git checkout pr_639
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=0.9.0-21127c6

Comment thread pkg/gameservers/gameservercounter.go Outdated

// Counts returns the NodeCount map in a thread safe way
func (ac *AllocationCounter) Counts() map[string]NodeCount {
func (ac *GameServerCounter) Counts() map[string]NodeCount {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: same as in the previous PR

Suggested change
func (ac *GameServerCounter) Counts() map[string]NodeCount {
func (gc *GameServerCounter) Counts() map[string]NodeCount {

Comment thread pkg/gameservers/gameservercounter.go Outdated
)

// AllocationCounter counts how many Allocated and
// GameServerCounter counts how many Allocated and

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we call it PerNodeCounter or something likethat? this is to avoid stuttering "gameservers.GameServerCounter", instead "gameservers.PerNodeCounter"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it. That reads much better. Making this change!

@markmandel
markmandel force-pushed the refactor/gameservercount branch from 21127c6 to a5cd54d Compare March 7, 2019 17:34
@agones-bot

Copy link
Copy Markdown
Collaborator

Build Succeeded 👏

Build Id: 6b024e51-34ba-4421-a023-e37b67249d2d

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/639/head:pr_639 && git checkout pr_639
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=0.9.0-a5cd54d

Precursor to agones-dev#638 - this moves the AllocationCounter code
to a more central GameServerCounter (which I think is a better name)
that tracks the number of Ready and Allocated GameServers that are
available on each node.

These details are useful for sorting for `Packed` scheduling strategies.

Once this PR is completed, we can use this Count() values provided by this
controller in the GameServerSet scale down logic, to ensure that GameServers
on the least used nodes are removed first when using a Packed strategy.
@markmandel
markmandel force-pushed the refactor/gameservercount branch from a5cd54d to be0718d Compare March 11, 2019 02:41
@agones-bot

Copy link
Copy Markdown
Collaborator

Build Succeeded 👏

Build Id: 7c65795d-2107-4e45-bee5-3037a0e7e9d8

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/639/head:pr_639 && git checkout pr_639
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=0.9.0-be0718d

@markmandel
markmandel merged commit b133e52 into agones-dev:master Mar 11, 2019
@markmandel
markmandel deleted the refactor/gameservercount branch March 11, 2019 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Refactoring code, fixing up documentation, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants