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 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 a NetworkStatus record class.
      Parameters:
      total - the value for the total record component
      groups - the value for the groups record component
      instances - the value for the instances record component
      other - the value for the other record component
      metricsAvailable - the value for the metricsAvailable record component
      players - the value for the players record component
      servers - the value for the servers record component
      proxies - the value for the proxies record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • total

      public ResourceUsage total()
      Returns the value of the total record component.
      Returns:
      the value of the total record component
    • groups

      public List<GroupStatus> groups()
      Returns the value of the groups record component.
      Returns:
      the value of the groups record component
    • instances

      public List<InstanceStatus> instances()
      Returns the value of the instances record component.
      Returns:
      the value of the instances record component
    • other

      public ResourceUsage other()
      Returns the value of the other record component.
      Returns:
      the value of the other record component
    • metricsAvailable

      public boolean metricsAvailable()
      Returns the value of the metricsAvailable record component.
      Returns:
      the value of the metricsAvailable record component
    • players

      public int players()
      Returns the value of the players record component.
      Returns:
      the value of the players record component
    • servers

      public int servers()
      Returns the value of the servers record component.
      Returns:
      the value of the servers record component
    • proxies

      public int proxies()
      Returns the value of the proxies record component.
      Returns:
      the value of the proxies record component