Giter VIP home page Giter VIP logo

Comments (5)

markmandel avatar markmandel commented on June 4, 2024

/cc @igooch

from agones.

igooch avatar igooch commented on June 4, 2024

Defaulting is in the CRD:

capacity:
title: Max capacity of the counter
type: integer
default: 1000
minimum: 0

from agones.

igooch avatar igooch commented on June 4, 2024

The number 0 is meaningful for Capacity (there's more places in fleetautoscaler, gameserverallocation, etc.):

// Truncate to Capacity if Count > Capacity
if cnt > counter.Capacity {
cnt = counter.Capacity
}

if newCnt > counter.Capacity {
newCnt = counter.Capacity
s.logger.Debug("truncating Count in Update Counter request to Capacity")
}

It's only the MaxAvailable where 0 = max(int64):

// MaxAvailable specifies the maximum capacity (current capacity - current count) available on a GameServer. Defaults to 0, which translates to max(int64).
// +optional
MaxAvailable int64 `json:"maxAvailable"`

We can set the default to 9223372036854775807, but I don't think we want to make 0 equal MaxInt64 because setting the Capacity to 0 is easiest way for the user to "delete" the Counter since they can't actually delete it.

from agones.

markmandel avatar markmandel commented on June 4, 2024

The number 0 is meaningful for Capacity (there's more places in fleetautoscaler, gameserverallocation, etc.):

aaah yeah, I can 100% see how that makes things way more complicated in the code. I agree, moving it to max(int64) is a better solution 👍🏻

Also making a note we should document this as well, as I think we don't document defaults for counter capacity, but we do for Counters.

@igooch you want to take this, or @Kalaiselvi84 this could be good for you? it's mostly a change in the default specified in #3579 (comment) and then updating the docs around counter default values in the example yamls and gameserver.md reference (I think that's the only spots).

from agones.

Kalaiselvi84 avatar Kalaiselvi84 commented on June 4, 2024

I will take on this work..

from agones.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.