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
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Represents a single entry in the cache.static class
Helper which takes an original entry iterator and transforms it into aDebugCacheStatistics.CacheEntry
when the entry is requested. -
Constructor Summary
ConstructorDescriptionDebugCacheStatistics
(String cacheName, org.springframework.cache.Cache cache) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.cache.Cache
getCache()
AnIterable
to the entries of the cache.getGets()
getHits()
getItems()
Number of items present in the cache.Maximum number of items that can be stored in the cache.getPuts()
org.springframework.core.ResolvableType
void
setAverageGetTime
(Float averageGetTime) void
setAveragePutTime
(Float averagePutTime) void
setAverageRemoveTime
(Float averageRemoveTime) void
setCacheEntries
(Iterable<DebugCacheStatistics.CacheEntry> cacheEntries) AnIterable
to the entries of the cache.<V> void
setCacheEntryIterator
(@NonNull Iterable<V> original, @NonNull Function<V, DebugCacheStatistics.CacheEntry> transformFunction) Short-hand for providing a cache entry iterator by transforming original entries into aDebugCacheStatistics.CacheEntry
whenever they are requested.void
setEvictions
(Long evictions) void
void
setHitPercentage
(Float hitPercentage) void
void
Number of items present in the cache.void
setMaxItems
(Long maxItems) Maximum number of items that can be stored in the cache.void
void
setMissPercentage
(Float missPercentage) void
void
setRemovals
(Long removals)
-
Constructor Details
-
DebugCacheStatistics
-
-
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 aDebugCacheStatistics.CacheEntry
whenever they are requested. -
getResolvableType
public org.springframework.core.ResolvableType getResolvableType()- Specified by:
getResolvableType
in interfaceorg.springframework.core.ResolvableTypeProvider
-
getCacheName
-
getCache
public org.springframework.cache.Cache getCache() -
getItems
Number of items present in the cache. -
getMaxItems
Maximum number of items that can be stored in the cache. -
getHits
- See Also:
-
javax.cache.management.CacheStatisticsMXBean#getCacheHits()
-
getHitPercentage
- See Also:
-
javax.cache.management.CacheStatisticsMXBean#getCacheHitPercentage()
-
getMisses
- See Also:
-
javax.cache.management.CacheStatisticsMXBean#getCacheMisses()
-
getMissPercentage
- See Also:
-
javax.cache.management.CacheStatisticsMXBean#getCacheMissPercentage()
-
getGets
- See Also:
-
()
-
getPuts
- See Also:
-
javax.cache.management.CacheStatisticsMXBean#getCachePuts()
-
getRemovals
- See Also:
-
javax.cache.management.CacheStatisticsMXBean#getCacheRemovals()
-
getEvictions
- See Also:
-
javax.cache.management.CacheStatisticsMXBean#getCacheEvictions()
-
getAverageGetTime
- See Also:
-
javax.cache.management.CacheStatisticsMXBean#getAverageGetTime()
-
getAveragePutTime
- See Also:
-
javax.cache.management.CacheStatisticsMXBean#getAveragePutTime()
-
getAverageRemoveTime
- See Also:
-
javax.cache.management.CacheStatisticsMXBean#getAverageRemoveTime()
-
getCacheEntries
AnIterable
to the entries of the cache. Can benull
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 usesetCacheEntryIterator(Iterable, Function)
. -
setItems
Number of items present in the cache. -
setMaxItems
Maximum number of items that can be stored in the cache. -
setHits
- See Also:
-
javax.cache.management.CacheStatisticsMXBean#getCacheHits()
-
setHitPercentage
- See Also:
-
javax.cache.management.CacheStatisticsMXBean#getCacheHitPercentage()
-
setMisses
- See Also:
-
javax.cache.management.CacheStatisticsMXBean#getCacheMisses()
-
setMissPercentage
- See Also:
-
javax.cache.management.CacheStatisticsMXBean#getCacheMissPercentage()
-
setGets
- See Also:
-
()
-
setPuts
- See Also:
-
javax.cache.management.CacheStatisticsMXBean#getCachePuts()
-
setRemovals
- See Also:
-
javax.cache.management.CacheStatisticsMXBean#getCacheRemovals()
-
setEvictions
- See Also:
-
javax.cache.management.CacheStatisticsMXBean#getCacheEvictions()
-
setAverageGetTime
- See Also:
-
javax.cache.management.CacheStatisticsMXBean#getAverageGetTime()
-
setAveragePutTime
- See Also:
-
javax.cache.management.CacheStatisticsMXBean#getAveragePutTime()
-
setAverageRemoveTime
- See Also:
-
javax.cache.management.CacheStatisticsMXBean#getAverageRemoveTime()
-
setCacheEntries
AnIterable
to the entries of the cache. Can benull
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 usesetCacheEntryIterator(Iterable, Function)
.
-