Class DebugCacheStatistics<T extends org.springframework.cache.Cache>

java.lang.Object
com.foreach.across.modules.debugweb.events.DebugCacheStatistics<T>
All Implemented Interfaces:
org.springframework.core.ResolvableTypeProvider

public class DebugCacheStatistics<T extends org.springframework.cache.Cache> extends Object implements org.springframework.core.ResolvableTypeProvider
Published when general statistics for a Cache are to be gathered.
Since:
3.0.0
Author:
Arne Vandamme
  • Constructor Details

    • DebugCacheStatistics

      public DebugCacheStatistics(String cacheName, org.springframework.cache.Cache cache)
  • Method Details

    • setCacheEntryIterator

      public <V> void setCacheEntryIterator(@NonNull @NonNull Iterable<V> original, @NonNull @NonNull Function<V,DebugCacheStatistics.CacheEntry> transformFunction)
      Short-hand for providing a cache entry iterator by transforming original entries into a DebugCacheStatistics.CacheEntry whenever they are requested.
    • getResolvableType

      public org.springframework.core.ResolvableType getResolvableType()
      Specified by:
      getResolvableType in interface org.springframework.core.ResolvableTypeProvider
    • getCacheName

      public String getCacheName()
    • getCache

      public org.springframework.cache.Cache getCache()
    • getItems

      public Long getItems()
      Number of items present in the cache.
    • getMaxItems

      public Long getMaxItems()
      Maximum number of items that can be stored in the cache.
    • getHits

      public Long getHits()
      See Also:
      • javax.cache.management.CacheStatisticsMXBean#getCacheHits()
    • getHitPercentage

      public Float getHitPercentage()
      See Also:
      • javax.cache.management.CacheStatisticsMXBean#getCacheHitPercentage()
    • getMisses

      public Long getMisses()
      See Also:
      • javax.cache.management.CacheStatisticsMXBean#getCacheMisses()
    • getMissPercentage

      public Float getMissPercentage()
      See Also:
      • javax.cache.management.CacheStatisticsMXBean#getCacheMissPercentage()
    • getGets

      public Long getGets()
      See Also:
      • ()
    • getPuts

      public Long getPuts()
      See Also:
      • javax.cache.management.CacheStatisticsMXBean#getCachePuts()
    • getRemovals

      public Long getRemovals()
      See Also:
      • javax.cache.management.CacheStatisticsMXBean#getCacheRemovals()
    • getEvictions

      public Long getEvictions()
      See Also:
      • javax.cache.management.CacheStatisticsMXBean#getCacheEvictions()
    • getAverageGetTime

      public Float getAverageGetTime()
      See Also:
      • javax.cache.management.CacheStatisticsMXBean#getAverageGetTime()
    • getAveragePutTime

      public Float getAveragePutTime()
      See Also:
      • javax.cache.management.CacheStatisticsMXBean#getAveragePutTime()
    • getAverageRemoveTime

      public Float getAverageRemoveTime()
      See Also:
      • javax.cache.management.CacheStatisticsMXBean#getAverageRemoveTime()
    • getCacheEntries

      public Iterable<DebugCacheStatistics.CacheEntry> getCacheEntries()
      An Iterable to the entries of the cache. Can be null if details are not available. If you want to have lazy transformation of an original cache entry (for performance reasons you often do), you can use setCacheEntryIterator(Iterable, Function).
      See Also:
    • setItems

      public void setItems(Long items)
      Number of items present in the cache.
    • setMaxItems

      public void setMaxItems(Long maxItems)
      Maximum number of items that can be stored in the cache.
    • setHits

      public void setHits(Long hits)
      See Also:
      • javax.cache.management.CacheStatisticsMXBean#getCacheHits()
    • setHitPercentage

      public void setHitPercentage(Float hitPercentage)
      See Also:
      • javax.cache.management.CacheStatisticsMXBean#getCacheHitPercentage()
    • setMisses

      public void setMisses(Long misses)
      See Also:
      • javax.cache.management.CacheStatisticsMXBean#getCacheMisses()
    • setMissPercentage

      public void setMissPercentage(Float missPercentage)
      See Also:
      • javax.cache.management.CacheStatisticsMXBean#getCacheMissPercentage()
    • setGets

      public void setGets(Long gets)
      See Also:
      • ()
    • setPuts

      public void setPuts(Long puts)
      See Also:
      • javax.cache.management.CacheStatisticsMXBean#getCachePuts()
    • setRemovals

      public void setRemovals(Long removals)
      See Also:
      • javax.cache.management.CacheStatisticsMXBean#getCacheRemovals()
    • setEvictions

      public void setEvictions(Long evictions)
      See Also:
      • javax.cache.management.CacheStatisticsMXBean#getCacheEvictions()
    • setAverageGetTime

      public void setAverageGetTime(Float averageGetTime)
      See Also:
      • javax.cache.management.CacheStatisticsMXBean#getAverageGetTime()
    • setAveragePutTime

      public void setAveragePutTime(Float averagePutTime)
      See Also:
      • javax.cache.management.CacheStatisticsMXBean#getAveragePutTime()
    • setAverageRemoveTime

      public void setAverageRemoveTime(Float averageRemoveTime)
      See Also:
      • javax.cache.management.CacheStatisticsMXBean#getAverageRemoveTime()
    • setCacheEntries

      public void setCacheEntries(Iterable<DebugCacheStatistics.CacheEntry> cacheEntries)
      An Iterable to the entries of the cache. Can be null if details are not available. If you want to have lazy transformation of an original cache entry (for performance reasons you often do), you can use setCacheEntryIterator(Iterable, Function).
      See Also: