Record Class LoomMap.LoomMapStats
java.lang.Object
java.lang.Record
com.loomcache.client.LoomMap.LoomMapStats
- Record Components:
localCacheHits- number of operations satisfied without a remote round-tripremoteFetches- number of operations that issued a remote requesttotalOps- total number of operations performedavgLatencyMs- average operation latency in milliseconds
public static record LoomMap.LoomMapStats(long localCacheHits, long remoteFetches, long totalOps, double avgLatencyMs)
extends Record
Statistics snapshot for a LoomMap operation.
localCacheHits reflects the fraction of operations whose result
was served without hitting the wire — i.e. totalOps - remoteFetches.
Every LoomMap call that reaches the client goes through the shared
LoomClient, which handles its own near cache; LoomMap itself
only measures the work it dispatches, so in the absence of richer
bookkeeping every recorded operation is counted as a remote fetch and
localCacheHits stays at zero.
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionLoomMapStats(long localCacheHits, long remoteFetches, long totalOps, double avgLatencyMs) Creates an instance of aLoomMapStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theavgLatencyMsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleReturns the local cache hit rate as a percentage (0.0 to 100.0).longReturns the value of thelocalCacheHitsrecord component.longReturns the value of theremoteFetchesrecord component.final StringtoString()Returns a string representation of this record class.longtotalOps()Returns the value of thetotalOpsrecord component.
-
Constructor Details
-
LoomMapStats
public LoomMapStats(long localCacheHits, long remoteFetches, long totalOps, double avgLatencyMs) Creates an instance of aLoomMapStatsrecord class.- Parameters:
localCacheHits- the value for thelocalCacheHitsrecord componentremoteFetches- the value for theremoteFetchesrecord componenttotalOps- the value for thetotalOpsrecord componentavgLatencyMs- the value for theavgLatencyMsrecord component
-
-
Method Details
-
hitRatePercent
public double hitRatePercent()Returns the local cache hit rate as a percentage (0.0 to 100.0). -
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 with thecomparemethod from their corresponding wrapper classes. -
localCacheHits
public long localCacheHits()Returns the value of thelocalCacheHitsrecord component.- Returns:
- the value of the
localCacheHitsrecord component
-
remoteFetches
public long remoteFetches()Returns the value of theremoteFetchesrecord component.- Returns:
- the value of the
remoteFetchesrecord component
-
totalOps
-
avgLatencyMs
public double avgLatencyMs()Returns the value of theavgLatencyMsrecord component.- Returns:
- the value of the
avgLatencyMsrecord component
-