Package cloud.spawnery.agent.api
Record Class NetworkStatus
java.lang.Object
java.lang.Record
cloud.spawnery.agent.api.NetworkStatus
public record NetworkStatus(ResourceUsage total, List<GroupStatus> groups, List<InstanceStatus> instances, ResourceUsage other, boolean metricsAvailable, int players, int servers, int proxies)
extends Record
The answer to
SpawneryApi.status(): this network's usage and tick
rates, never anything outside its namespace.
For the whole network, groups has every group and
instances is empty; other is the namespace's pods outside
every listed group. For a group, groups is that group and
instances its members. For one server or proxy, groups is
empty and instances is that one. total is always the usage
of what was asked about.
metricsAvailable false means the cluster serves no metrics API;
every usage then has requests and limits but nothing measured.
-
Constructor Summary
ConstructorsConstructorDescriptionNetworkStatus(ResourceUsage total, List<GroupStatus> groups, List<InstanceStatus> instances, ResourceUsage other, boolean metricsAvailable, int players, int servers, int proxies) Creates an instance of aNetworkStatusrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.groups()Returns the value of thegroupsrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theinstancesrecord component.booleanReturns the value of themetricsAvailablerecord component.other()Returns the value of theotherrecord component.intplayers()Returns the value of theplayersrecord component.intproxies()Returns the value of theproxiesrecord component.intservers()Returns the value of theserversrecord component.final StringtoString()Returns a string representation of this record class.total()Returns the value of thetotalrecord component.
-
Constructor Details
-
NetworkStatus
public NetworkStatus(ResourceUsage total, List<GroupStatus> groups, List<InstanceStatus> instances, ResourceUsage other, boolean metricsAvailable, int players, int servers, int proxies) Creates an instance of aNetworkStatusrecord class.- Parameters:
total- the value for thetotalrecord componentgroups- the value for thegroupsrecord componentinstances- the value for theinstancesrecord componentother- the value for theotherrecord componentmetricsAvailable- the value for themetricsAvailablerecord componentplayers- the value for theplayersrecord componentservers- the value for theserversrecord componentproxies- the value for theproxiesrecord component
-
-
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 '=='. -
total
Returns the value of thetotalrecord component.- Returns:
- the value of the
totalrecord component
-
groups
Returns the value of thegroupsrecord component.- Returns:
- the value of the
groupsrecord component
-
instances
Returns the value of theinstancesrecord component.- Returns:
- the value of the
instancesrecord component
-
other
Returns the value of theotherrecord component.- Returns:
- the value of the
otherrecord component
-
metricsAvailable
public boolean metricsAvailable()Returns the value of themetricsAvailablerecord component.- Returns:
- the value of the
metricsAvailablerecord component
-
players
public int players()Returns the value of theplayersrecord component.- Returns:
- the value of the
playersrecord component
-
servers
public int servers()Returns the value of theserversrecord component.- Returns:
- the value of the
serversrecord component
-
proxies
public int proxies()Returns the value of theproxiesrecord component.- Returns:
- the value of the
proxiesrecord component
-