Class CacheStats

java.lang.Object
com.sap.cloud.sdk.cloudplatform.cache.CacheStats
All Implemented Interfaces:
CacheStatsMXBean

public class CacheStats extends Object implements CacheStatsMXBean
POJO implmentation of the CacheStatsMXBean interface.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CacheStats(long cacheSize, long hitCount, long missCount, long loadSuccessCount, long loadExceptionCount, long totalLoadTime, long evictionCount)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
     
    boolean
     
    long
     
    long
    Returns the number of times an entry has been evicted.
    long
    Returns the number of times Cache lookup methods have returned a cached value.
    long
    Returns the number of times Cache lookup methods threw an exception while loading a new value.
    long
    Returns the number of times Cache lookup methods have successfully loaded a new value.
    long
    Returns the number of times Cache lookup methods have returned an uncached (newly loaded) value, or null.
    long
    Returns the total number of nanoseconds the cache has spent loading new values.
    int
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CacheStats

      public CacheStats(long cacheSize, long hitCount, long missCount, long loadSuccessCount, long loadExceptionCount, long totalLoadTime, long evictionCount)
  • Method Details

    • getCacheSize

      public long getCacheSize()
    • getHitCount

      public long getHitCount()
      Description copied from interface: CacheStatsMXBean
      Returns the number of times Cache lookup methods have returned a cached value.
      Specified by:
      getHitCount in interface CacheStatsMXBean
      Returns:
      The number of successful cache lookups.
      See Also:
      • CacheStats.hitCount()
    • getMissCount

      public long getMissCount()
      Description copied from interface: CacheStatsMXBean
      Returns the number of times Cache lookup methods have returned an uncached (newly loaded) value, or null. Multiple concurrent calls to Cache lookup methods on an absent value can result in multiple misses, all returning the results of a single cache load operation.
      Specified by:
      getMissCount in interface CacheStatsMXBean
      Returns:
      The number of cache lookup misses.
      See Also:
      • CacheStats.missCount()
    • getLoadSuccessCount

      public long getLoadSuccessCount()
      Description copied from interface: CacheStatsMXBean
      Returns the number of times Cache lookup methods have successfully loaded a new value. This is usually incremented in conjunction with CacheStatsMXBean.getMissCount(), though getMissCount is also incremented when an exception is encountered during cache loading (see CacheStatsMXBean.getLoadExceptionCount()). Multiple concurrent misses for the same key will result in a single load operation. This may be incremented not in conjunction with getMissCount if the load occurs as a result of a refresh or if the cache loader returned more items than was requested. getMissCount may also be incremented not in conjunction with this (nor CacheStatsMXBean.getLoadExceptionCount()) on calls to getIfPresent.
      Specified by:
      getLoadSuccessCount in interface CacheStatsMXBean
      Returns:
      The number of successful loads of new cache entries.
      See Also:
      • CacheStats.loadSuccessCount()
    • getLoadExceptionCount

      public long getLoadExceptionCount()
      Description copied from interface: CacheStatsMXBean
      Returns the number of times Cache lookup methods threw an exception while loading a new value. This is usually incremented in conjunction with getMissCount, though getMissCount is also incremented when cache loading completes successfully (see CacheStatsMXBean.getLoadSuccessCount()). Multiple concurrent misses for the same key will result in a single load operation. This may be incremented not in conjunction with getMissCount if the load occurs as a result of a refresh or if the cache loader returned more items than was requested. getMissCount may also be incremented not in conjunction with this (nor CacheStatsMXBean.getLoadSuccessCount()) on calls to getIfPresent.
      Specified by:
      getLoadExceptionCount in interface CacheStatsMXBean
      Returns:
      The number of exception during the load of new cache entries.
      See Also:
      • CacheStats.loadExceptionCount()
    • getTotalLoadTime

      public long getTotalLoadTime()
      Description copied from interface: CacheStatsMXBean
      Returns the total number of nanoseconds the cache has spent loading new values. This can be used to calculate the miss penalty. This value is increased every time getLoadSuccessCount or getLoadExceptionCount is incremented.
      Specified by:
      getTotalLoadTime in interface CacheStatsMXBean
      Returns:
      The total time spent loading new values, in nanoseconds.
      See Also:
      • CacheStats.totalLoadTime()
    • getEvictionCount

      public long getEvictionCount()
      Description copied from interface: CacheStatsMXBean
      Returns the number of times an entry has been evicted. This count does not include manual invalidations.
      Specified by:
      getEvictionCount in interface CacheStatsMXBean
      Returns:
      The number of automatic eviction of entries.
      See Also:
      • CacheStats.evictionCount()
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(@Nullable Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object