Record Class UtilizationSnapshot.Stats

java.lang.Object
java.lang.Record
com.eqixiac.equinix.design.estate.UtilizationSnapshot.Stats
Record Components:
resourceId - the resource id
provisionedMbps - the provisioned bandwidth the percentages are relative to; null when unknown
samples - the number of intervals with data
interval - the sample interval as the API reported it (for example PT1H)
p50Mbps - the median, or null when unknown
p95Mbps - the 95th percentile, or null when unknown
peakMbps - the maximum, or null when unknown
unknownReason - why the figures are unknown; null when known
Enclosing class:
UtilizationSnapshot

public static record UtilizationSnapshot.Stats(String resourceId, Integer provisionedMbps, int samples, String interval, Double p50Mbps, Double p95Mbps, Double peakMbps, String unknownReason) extends Record
Utilisation of one resource. Rates are in Mbps; each sample is the larger of the transmit and receive rates for the same interval, because a Fabric connection's bandwidth limit applies to each direction separately.
  • Constructor Details

    • Stats

      public Stats(String resourceId, Integer provisionedMbps, int samples, String interval, Double p50Mbps, Double p95Mbps, Double peakMbps, String unknownReason)
      Creates an instance of a Stats record class.
      Parameters:
      resourceId - the value for the resourceId record component
      provisionedMbps - the value for the provisionedMbps record component
      samples - the value for the samples record component
      interval - the value for the interval record component
      p50Mbps - the value for the p50Mbps record component
      p95Mbps - the value for the p95Mbps record component
      peakMbps - the value for the peakMbps record component
      unknownReason - the value for the unknownReason record component
  • Method Details

    • unknown

      public static UtilizationSnapshot.Stats unknown(String resourceId, Integer provisionedMbps, String reason)
      Stats for a resource with no usable data.
      Parameters:
      resourceId - the resource id
      provisionedMbps - the provisioned bandwidth, or null
      reason - why the data is missing
      Returns:
      the unknown stats
    • reduce

      public static UtilizationSnapshot.Stats reduce(String resourceId, Integer provisionedMbps, String interval, List<Double> samplesMbps)
      Reduces samples to percentiles. An empty sample list gives unknown stats.
      Parameters:
      resourceId - the resource id
      provisionedMbps - the provisioned bandwidth, or null
      interval - the sample interval label, or null
      samplesMbps - the samples in Mbps (nulls and NaN are ignored)
      Returns:
      the stats
    • known

      public boolean known()
      Whether the figures are known.
      Returns:
      true when there is data
    • p95Percent

      public Optional<Double> p95Percent()
      The 95th percentile as a percent of the provisioned bandwidth.
      Returns:
      the percent, or empty when either figure is unknown
    • peakPercent

      public Optional<Double> peakPercent()
      The peak as a percent of the provisioned bandwidth.
      Returns:
      the percent, or empty when unknown
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • resourceId

      public String resourceId()
      Returns the value of the resourceId record component.
      Returns:
      the value of the resourceId record component
    • provisionedMbps

      public Integer provisionedMbps()
      Returns the value of the provisionedMbps record component.
      Returns:
      the value of the provisionedMbps record component
    • samples

      public int samples()
      Returns the value of the samples record component.
      Returns:
      the value of the samples record component
    • interval

      public String interval()
      Returns the value of the interval record component.
      Returns:
      the value of the interval record component
    • p50Mbps

      public Double p50Mbps()
      Returns the value of the p50Mbps record component.
      Returns:
      the value of the p50Mbps record component
    • p95Mbps

      public Double p95Mbps()
      Returns the value of the p95Mbps record component.
      Returns:
      the value of the p95Mbps record component
    • peakMbps

      public Double peakMbps()
      Returns the value of the peakMbps record component.
      Returns:
      the value of the peakMbps record component
    • unknownReason

      public String unknownReason()
      Returns the value of the unknownReason record component.
      Returns:
      the value of the unknownReason record component