Record Class ModernSearchCache.CacheStats
java.lang.Object
java.lang.Record
com.university.bookstore.search.ModernSearchCache.CacheStats
- Record Components:
hitCount- number of cache hitsmissCount- number of cache missesevictionCount- number of cache evictionsloadCount- number of cache loadshitRate- cache hit rate (0.0 to 1.0)averageLoadTime- average time to load datasize- current cache sizetotalAccessCount- total number of cache accesses
- Enclosing class:
ModernSearchCache
public static record ModernSearchCache.CacheStats(long hitCount, long missCount, long evictionCount, long loadCount, double hitRate, double averageLoadTime, int size, long totalAccessCount)
extends Record
Cache statistics record.
- Since:
- 2024-09-15
- Version:
- 4.0
- Author:
- Navid Mohaghegh
-
Constructor Summary
ConstructorsConstructorDescriptionCacheStats(long hitCount, long missCount, long evictionCount, long loadCount, double hitRate, double averageLoadTime, int size, long totalAccessCount) Creates an instance of aCacheStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theaverageLoadTimerecord component.final booleanIndicates whether some other object is "equal to" this one.longReturns the value of theevictionCountrecord component.Creates a summary string.final inthashCode()Returns a hash code value for this object.longhitCount()Returns the value of thehitCountrecord component.doublehitRate()Returns the value of thehitRaterecord component.longReturns the value of theloadCountrecord component.longReturns the value of themissCountrecord component.intsize()Returns the value of thesizerecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalAccessCountrecord component.
-
Constructor Details
-
CacheStats
public CacheStats(long hitCount, long missCount, long evictionCount, long loadCount, double hitRate, double averageLoadTime, int size, long totalAccessCount) Creates an instance of aCacheStatsrecord class.- Parameters:
hitCount- the value for thehitCountrecord componentmissCount- the value for themissCountrecord componentevictionCount- the value for theevictionCountrecord componentloadCount- the value for theloadCountrecord componenthitRate- the value for thehitRaterecord componentaverageLoadTime- the value for theaverageLoadTimerecord componentsize- the value for thesizerecord componenttotalAccessCount- the value for thetotalAccessCountrecord component
-
-
Method Details
-
getSummary
Creates a summary string. -
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. -
hitCount
-
missCount
-
evictionCount
public long evictionCount()Returns the value of theevictionCountrecord component.- Returns:
- the value of the
evictionCountrecord component
-
loadCount
-
hitRate
-
averageLoadTime
public double averageLoadTime()Returns the value of theaverageLoadTimerecord component.- Returns:
- the value of the
averageLoadTimerecord component
-
size
-
totalAccessCount
public long totalAccessCount()Returns the value of thetotalAccessCountrecord component.- Returns:
- the value of the
totalAccessCountrecord component
-