Package cloud.spawnery.agent.api
Record Class InstanceStatus
java.lang.Object
java.lang.Record
cloud.spawnery.agent.api.InstanceStatus
public record InstanceStatus(String name, String group, boolean proxy, String phase, boolean ready, int players, int slots, OptionalDouble tps, OptionalDouble mspt, Duration age, boolean retiring, boolean held, boolean draining, ResourceUsage usage, String node, int playableSlots)
extends Record
One server or proxy in a
NetworkStatus. phase is empty for
a proxy, whose state is ready and draining. tps and
mspt are empty for a proxy and for a server that has not reported.
node is the Kubernetes node the pod runs on, empty while it is not
scheduled. playableSlots is how many of slots count as
capacity, equal to slots when nothing narrowed it.-
Constructor Summary
ConstructorsConstructorDescriptionInstanceStatus(String name, String group, boolean proxy, String phase, boolean ready, int players, int slots, OptionalDouble tps, OptionalDouble mspt, Duration age, boolean retiring, boolean held, boolean draining, ResourceUsage usage) The record as it was beforenode, which it reads as not scheduled.InstanceStatus(String name, String group, boolean proxy, String phase, boolean ready, int players, int slots, OptionalDouble tps, OptionalDouble mspt, Duration age, boolean retiring, boolean held, boolean draining, ResourceUsage usage, String node) The record as it was beforeplayableSlots, which it reads as every seat.InstanceStatus(String name, String group, boolean proxy, String phase, boolean ready, int players, int slots, OptionalDouble tps, OptionalDouble mspt, Duration age, boolean retiring, boolean held, boolean draining, ResourceUsage usage, String node, int playableSlots) Creates an instance of aInstanceStatusrecord class. -
Method Summary
Modifier and TypeMethodDescriptionage()Returns the value of theagerecord component.booleandraining()Returns the value of thedrainingrecord component.final booleanIndicates whether some other object is "equal to" this one.group()Returns the value of thegrouprecord component.final inthashCode()Returns a hash code value for this object.booleanheld()Returns the value of theheldrecord component.mspt()Returns the value of themsptrecord component.name()Returns the value of thenamerecord component.node()Returns the value of thenoderecord component.phase()Returns the value of thephaserecord component.intReturns the value of theplayableSlotsrecord component.intplayers()Returns the value of theplayersrecord component.booleanproxy()Returns the value of theproxyrecord component.booleanready()Returns the value of thereadyrecord component.booleanretiring()Returns the value of theretiringrecord component.intslots()Returns the value of theslotsrecord component.final StringtoString()Returns a string representation of this record class.tps()Returns the value of thetpsrecord component.usage()Returns the value of theusagerecord component.
-
Constructor Details
-
InstanceStatus
public InstanceStatus(String name, String group, boolean proxy, String phase, boolean ready, int players, int slots, OptionalDouble tps, OptionalDouble mspt, Duration age, boolean retiring, boolean held, boolean draining, ResourceUsage usage, String node, int playableSlots) Creates an instance of aInstanceStatusrecord class.- Parameters:
name- the value for thenamerecord componentgroup- the value for thegrouprecord componentproxy- the value for theproxyrecord componentphase- the value for thephaserecord componentready- the value for thereadyrecord componentplayers- the value for theplayersrecord componentslots- the value for theslotsrecord componenttps- the value for thetpsrecord componentmspt- the value for themsptrecord componentage- the value for theagerecord componentretiring- the value for theretiringrecord componentheld- the value for theheldrecord componentdraining- the value for thedrainingrecord componentusage- the value for theusagerecord componentnode- the value for thenoderecord componentplayableSlots- the value for theplayableSlotsrecord component
-
InstanceStatus
public InstanceStatus(String name, String group, boolean proxy, String phase, boolean ready, int players, int slots, OptionalDouble tps, OptionalDouble mspt, Duration age, boolean retiring, boolean held, boolean draining, ResourceUsage usage, String node) The record as it was beforeplayableSlots, which it reads as every seat. -
InstanceStatus
public InstanceStatus(String name, String group, boolean proxy, String phase, boolean ready, int players, int slots, OptionalDouble tps, OptionalDouble mspt, Duration age, boolean retiring, boolean held, boolean draining, ResourceUsage usage) The record as it was beforenode, which it reads as not scheduled.
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
group
Returns the value of thegrouprecord component.- Returns:
- the value of the
grouprecord component
-
proxy
public boolean proxy()Returns the value of theproxyrecord component.- Returns:
- the value of the
proxyrecord component
-
phase
Returns the value of thephaserecord component.- Returns:
- the value of the
phaserecord component
-
ready
public boolean ready()Returns the value of thereadyrecord component.- Returns:
- the value of the
readyrecord component
-
players
public int players()Returns the value of theplayersrecord component.- Returns:
- the value of the
playersrecord component
-
slots
public int slots()Returns the value of theslotsrecord component.- Returns:
- the value of the
slotsrecord component
-
tps
Returns the value of thetpsrecord component.- Returns:
- the value of the
tpsrecord component
-
mspt
Returns the value of themsptrecord component.- Returns:
- the value of the
msptrecord component
-
age
Returns the value of theagerecord component.- Returns:
- the value of the
agerecord component
-
retiring
public boolean retiring()Returns the value of theretiringrecord component.- Returns:
- the value of the
retiringrecord component
-
held
public boolean held()Returns the value of theheldrecord component.- Returns:
- the value of the
heldrecord component
-
draining
public boolean draining()Returns the value of thedrainingrecord component.- Returns:
- the value of the
drainingrecord component
-
usage
Returns the value of theusagerecord component.- Returns:
- the value of the
usagerecord component
-
node
Returns the value of thenoderecord component.- Returns:
- the value of the
noderecord component
-
playableSlots
public int playableSlots()Returns the value of theplayableSlotsrecord component.- Returns:
- the value of the
playableSlotsrecord component
-