Skip to content

Commit

Permalink
Docs: Default Counter Capacity as 1000 (#3637)
Browse files Browse the repository at this point in the history
* Docs: Default Counter Capacity as 1000

* update docs

* Review changes

* direct url to the github issue

* review change

---------

Co-authored-by: igooch <[email protected]>
  • Loading branch information
Kalaiselvi84 and igooch authored Feb 13, 2024
1 parent 8b2c442 commit db90b21
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/gameserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ spec:
# counters: # counters are int64 counters that can be incremented and decremented by set amounts. Keys must be declared at GameServer creation time.
# games: # arbitrary key.
# count: 1 # initial value.
# capacity: 100 # (Optional) Maximum value for the counter. 0 is max(int64).
# capacity: 100 # (Optional) Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. See GitHub issue https://github.com/googleforgames/agones/issues/3636 for more details.
# sessions:
# count: 1
# lists: # lists are lists of values stored against this GameServer that can be added and deleted from. Keys must be declared at GameServer creation time.
Expand Down
2 changes: 2 additions & 0 deletions site/content/en/docs/Guides/Client SDKs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ to the capacity of that Counter or List.
All functions will return an error if the specified `key` is not predefined in the
[`GameServer.Spec.Counters`][gameserverspec] resource configuration.

**Note:** For Counters, the default setting for the capacity is preset to 1000. It is recommended to avoid configuring the capacity to max(int64), as doing so could cause problems with [JSON Patch operations](https://github.com/googleforgames/agones/issues/3636).

##### Alpha().GetCounterCount(key)

This function retrieves either the [`GameServer.Status.Counters[key].Count`][gameserverstatus] or the SDK awaiting-batch
Expand Down
4 changes: 2 additions & 2 deletions site/content/en/docs/Reference/gameserver.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ spec:
# counters: # counters are int64 counters that can be incremented and decremented by set amounts. Keys must be declared at GameServer creation time.
# games: # arbitrary key.
# count: 1 # initial value.
# capacity: 100 # (Optional) Maximum value for the counter. 0 is max(int64).
# capacity: 100 # (Optional) Defaults to 1000 and setting capacity to max(int64) may lead to issues and is not recommended. See GitHub issue https://github.com/googleforgames/agones/issues/3636 for more details.
# sessions:
# count: 1
# lists: # lists are lists of values stored against this GameServer that can be added and deleted from. Keys must be declared at GameServer creation time.
Expand Down Expand Up @@ -146,7 +146,7 @@ The `spec` field is the actual GameServer specification and it is composed as fo
- `grpcPort` the port that the SDK Server binds to for gRPC connections
- `httpPort` the port that the SDK Server binds to for HTTP gRPC gateway connections
- `players` (Alpha, behind "PlayerTracking" feature gate), sets this GameServer's initial player capacity
- `counters` (Alpha, requires "CountsAndLists" feature flag) are int64 counters that can be incremented and decremented by set amounts. Keys must be declared at GameServer creation time.
- `counters` (Alpha, requires "CountsAndLists" feature flag) are int64 counters with a default capacity of 1000 that can be incremented and decremented by set amounts. Keys must be declared at GameServer creation time. Note that setting the capacity to max(int64) may lead to issues.
- `lists` (Alpha, requires "CountsAndLists" feature flag) are lists of values stored against this GameServer that can be added and deleted from. Key must be declared at GameServer creation time.
- `template` the [pod spec template]({{% k8s-api-version href="#podtemplatespec-v1-core" %}}) to run your GameServer containers, [see](https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/#pod-templates) for more information.

Expand Down

0 comments on commit db90b21

Please sign in to comment.