Record Class UtilizationSnapshot
java.lang.Object
java.lang.Record
com.eqixiac.equinix.design.estate.UtilizationSnapshot
- Record Components:
windowStart- the start of the windowwindowEnd- the end of the windowsource- where the data came from (for examplePOST /fabric/v4/metrics/search)stats- resource id to its utilisationcoverageGaps- 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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordUtilisation of one resource. -
Constructor Summary
ConstructorsConstructorDescriptionUtilizationSnapshot(Instant windowStart, Instant windowEnd, String source, Map<String, UtilizationSnapshot.Stats> stats, List<EstateInventory.CoverageGap> coverageGaps) Copies the collections (stats sorted by resource id). -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecoverageGapsrecord component.final booleanIndicates whether some other object is "equal to" this one.static UtilizationSnapshotReads a snapshot written bytoJson().final inthashCode()Returns a hash code value for this object.The utilisation of one resource, when known.static UtilizationSnapshotnone()A snapshot with no utilisation data (the probe was not run).source()Returns the value of thesourcerecord component.stats()Returns the value of thestatsrecord component.toJson()Serializes the snapshot to JSON.final StringtoString()Returns a string representation of this record class.window()The window length.Returns the value of thewindowEndrecord component.Returns the value of thewindowStartrecord component.intwithData()How many resources have data.
-
Constructor Details
-
UtilizationSnapshot
public UtilizationSnapshot(Instant windowStart, Instant windowEnd, String source, Map<String, UtilizationSnapshot.Stats> stats, List<EstateInventory.CoverageGap> coverageGaps) Copies the collections (stats sorted by resource id).
-
-
Method Details
-
none
A snapshot with no utilisation data (the probe was not run).- Returns:
- the empty snapshot
-
known
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
-
withData
public int withData()How many resources have data.- Returns:
- the count of entries with data
-
toJson
-
fromJson
Reads a snapshot written bytoJson().- Parameters:
json- the JSON document- Returns:
- the snapshot
-
toString
-
hashCode
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
windowStart
Returns the value of thewindowStartrecord component.- Returns:
- the value of the
windowStartrecord component
-
windowEnd
-
source
-
stats
-
coverageGaps
Returns the value of thecoverageGapsrecord component.- Returns:
- the value of the
coverageGapsrecord component
-