Record Class UtilizationSnapshot

java.lang.Object
java.lang.Record
com.eqixiac.equinix.design.estate.UtilizationSnapshot
Record Components:
windowStart - the start of the window
windowEnd - the end of the window
source - where the data came from (for example POST /fabric/v4/metrics/search)
stats - resource id to its utilisation
coverageGaps - metrics that could not be read

public record UtilizationSnapshot(Instant windowStart, Instant windowEnd, String source, Map<String, UtilizationSnapshot.Stats> stats, List<EstateInventory.CoverageGap> coverageGaps) extends Record
Bandwidth utilisation of the resources in an estate over one time window, reduced to percentiles. A resource with no data has an entry whose UtilizationSnapshot.Stats.known() is false and whose reason says why: missing data is unknown, never zero.
  • Constructor Details

  • Method Details

    • none

      public static UtilizationSnapshot none()
      A snapshot with no utilisation data (the probe was not run).
      Returns:
      the empty snapshot
    • known

      public Optional<UtilizationSnapshot.Stats> known(String resourceId)
      The utilisation of one resource, when known.
      Parameters:
      resourceId - the resource id
      Returns:
      the stats with data, or empty when unknown or not collected
    • window

      public Duration window()
      The window length.
      Returns:
      the window, or null when not collected
    • withData

      public int withData()
      How many resources have data.
      Returns:
      the count of entries with data
    • toJson

      public String toJson()
      Serializes the snapshot to JSON.
      Returns:
      the JSON document
    • fromJson

      public static UtilizationSnapshot fromJson(String json)
      Reads a snapshot written by toJson().
      Parameters:
      json - the JSON document
      Returns:
      the snapshot
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • windowStart

      public Instant windowStart()
      Returns the value of the windowStart record component.
      Returns:
      the value of the windowStart record component
    • windowEnd

      public Instant windowEnd()
      Returns the value of the windowEnd record component.
      Returns:
      the value of the windowEnd record component
    • source

      public String source()
      Returns the value of the source record component.
      Returns:
      the value of the source record component
    • stats

      Returns the value of the stats record component.
      Returns:
      the value of the stats record component
    • coverageGaps

      public List<EstateInventory.CoverageGap> coverageGaps()
      Returns the value of the coverageGaps record component.
      Returns:
      the value of the coverageGaps record component