Package org.cache2k.core
Class StandardCommonMetrics
- java.lang.Object
-
- org.cache2k.core.StandardCommonMetrics
-
- All Implemented Interfaces:
CommonMetrics
,CommonMetrics.Updater
public class StandardCommonMetrics extends Object implements CommonMetrics.Updater
- Author:
- Jens Wilke
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.cache2k.core.api.CommonMetrics
CommonMetrics.BlackHole, CommonMetrics.Updater
-
-
Constructor Summary
Constructors Constructor Description StandardCommonMetrics()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
expiredKept()
void
explicitLoad(long millis)
long
getExpiredKeptCount()
Number of entries expired, but kept in the cache because of ongoing processing on the entry (pinned) or because keepData is enabled.long
getExplicitLoadCount()
Entry was explicitly loaded, that is every load that is not read through or refresh.long
getGoneSpinCount()
Entry was removed while waiting to get the mutation lock.long
getHeapHitButNoReadCount()
Operation was accessing a heap entry and counted a hit if it is existing, but it should not be counted as read/get operation (e.g.long
getLoadExceptionCount()
Counter of exceptions thrown from the loader.long
getLoadMillis()
Accumulated milliseconds spend in load operations.long
getPeekHitNotFreshCount()
Peek, but entry available was not fresh (expired).long
getPeekMissCount()
Incremented if data is requested from the cache but no entry is present (e.g.long
getPutHitCount()
Counted for a put that updates an existing cache entry.long
getPutNewEntryCount()
Counted for a put that triggers the insert of a new cache entry.long
getReadThroughCount()
Entry was loaded, triggered by a get().long
getRefreshCount()
Entry was loaded again, triggered by timerlong
getRefreshedHitCount()
Entry on probation for refresh got hit.long
getRefreshRejectedCount()
Refresh submit failed.long
getSuppressedExceptionCount()
Counter of suppressed exceptions from the loaderlong
getTimerEventCount()
Count of timer events delivered to this cache.void
goneSpin()
void
heapHitButNoRead()
boolean
isDisabled()
True if statistics are disabled.void
loadException()
void
peekHitNotFresh()
void
peekMiss()
void
putHit()
void
putNewEntry()
void
readThrough(long millis)
void
refresh(long millis)
void
refreshedHit()
void
refreshRejected()
void
suppressedException()
void
timerEvent()
-
-
-
Method Detail
-
putNewEntry
public void putNewEntry()
- Specified by:
putNewEntry
in interfaceCommonMetrics.Updater
-
getPutNewEntryCount
public long getPutNewEntryCount()
Description copied from interface:CommonMetrics
Counted for a put that triggers the insert of a new cache entry.- Specified by:
getPutNewEntryCount
in interfaceCommonMetrics
- See Also:
InternalCacheInfo.getPutCount()
-
putHit
public void putHit()
- Specified by:
putHit
in interfaceCommonMetrics.Updater
-
getPutHitCount
public long getPutHitCount()
Description copied from interface:CommonMetrics
Counted for a put that updates an existing cache entry.- Specified by:
getPutHitCount
in interfaceCommonMetrics
- See Also:
InternalCacheInfo.getPutCount()
-
heapHitButNoRead
public void heapHitButNoRead()
- Specified by:
heapHitButNoRead
in interfaceCommonMetrics.Updater
-
getHeapHitButNoReadCount
public long getHeapHitButNoReadCount()
Description copied from interface:CommonMetrics
Operation was accessing a heap entry and counted a hit if it is existing, but it should not be counted as read/get operation (e.g.contains
). This is a correction counter applied to the get counter.- Specified by:
getHeapHitButNoReadCount
in interfaceCommonMetrics
-
timerEvent
public void timerEvent()
- Specified by:
timerEvent
in interfaceCommonMetrics.Updater
-
getTimerEventCount
public long getTimerEventCount()
Description copied from interface:CommonMetrics
Count of timer events delivered to this cache.- Specified by:
getTimerEventCount
in interfaceCommonMetrics
- See Also:
InternalCacheInfo.getTimerEventCount()
-
getLoadMillis
public long getLoadMillis()
Description copied from interface:CommonMetrics
Accumulated milliseconds spend in load operations.- Specified by:
getLoadMillis
in interfaceCommonMetrics
- See Also:
InternalCacheInfo.getLoadMillis()
-
getRefreshCount
public long getRefreshCount()
Description copied from interface:CommonMetrics
Entry was loaded again, triggered by timer- Specified by:
getRefreshCount
in interfaceCommonMetrics
- See Also:
InternalCacheInfo.getRefreshCount()
-
refresh
public void refresh(long millis)
- Specified by:
refresh
in interfaceCommonMetrics.Updater
-
getReadThroughCount
public long getReadThroughCount()
Description copied from interface:CommonMetrics
Entry was loaded, triggered by a get(). A read through event means also a get, load and miss event.- Specified by:
getReadThroughCount
in interfaceCommonMetrics
- See Also:
InternalCacheInfo.getLoadCount()
-
readThrough
public void readThrough(long millis)
- Specified by:
readThrough
in interfaceCommonMetrics.Updater
-
getExplicitLoadCount
public long getExplicitLoadCount()
Description copied from interface:CommonMetrics
Entry was explicitly loaded, that is every load that is not read through or refresh.- Specified by:
getExplicitLoadCount
in interfaceCommonMetrics
- See Also:
InternalCacheInfo.getExplicitLoadCount()
-
explicitLoad
public void explicitLoad(long millis)
- Specified by:
explicitLoad
in interfaceCommonMetrics.Updater
-
getLoadExceptionCount
public long getLoadExceptionCount()
Description copied from interface:CommonMetrics
Counter of exceptions thrown from the loader.- Specified by:
getLoadExceptionCount
in interfaceCommonMetrics
- See Also:
InternalCacheInfo.getLoadExceptionCount()
-
loadException
public void loadException()
- Specified by:
loadException
in interfaceCommonMetrics.Updater
-
getSuppressedExceptionCount
public long getSuppressedExceptionCount()
Description copied from interface:CommonMetrics
Counter of suppressed exceptions from the loader- Specified by:
getSuppressedExceptionCount
in interfaceCommonMetrics
- See Also:
InternalCacheInfo.getSuppressedExceptionCount()
-
suppressedException
public void suppressedException()
- Specified by:
suppressedException
in interfaceCommonMetrics.Updater
-
getExpiredKeptCount
public long getExpiredKeptCount()
Description copied from interface:CommonMetrics
Number of entries expired, but kept in the cache because of ongoing processing on the entry (pinned) or because keepData is enabled.- Specified by:
getExpiredKeptCount
in interfaceCommonMetrics
- See Also:
InternalCacheInfo.getExpiredCount()
-
expiredKept
public void expiredKept()
- Specified by:
expiredKept
in interfaceCommonMetrics.Updater
-
getPeekMissCount
public long getPeekMissCount()
Description copied from interface:CommonMetrics
Incremented if data is requested from the cache but no entry is present (e.g. via peek or get). If a load is started this is not incremented, since the actual miss is recorded via the load/readThrough counter.- Specified by:
getPeekMissCount
in interfaceCommonMetrics
-
peekMiss
public void peekMiss()
- Specified by:
peekMiss
in interfaceCommonMetrics.Updater
-
getPeekHitNotFreshCount
public long getPeekHitNotFreshCount()
Description copied from interface:CommonMetrics
Peek, but entry available was not fresh (expired). This is effectively a miss, but we count separately for debugging purposes. Always 0 if notCache2kBuilder.keepDataAfterExpired(boolean)
- Specified by:
getPeekHitNotFreshCount
in interfaceCommonMetrics
-
peekHitNotFresh
public void peekHitNotFresh()
- Specified by:
peekHitNotFresh
in interfaceCommonMetrics.Updater
-
getRefreshedHitCount
public long getRefreshedHitCount()
Description copied from interface:CommonMetrics
Entry on probation for refresh got hit.- Specified by:
getRefreshedHitCount
in interfaceCommonMetrics
- See Also:
InternalCacheInfo.getRefreshedHitCount()
-
refreshedHit
public void refreshedHit()
- Specified by:
refreshedHit
in interfaceCommonMetrics.Updater
-
getRefreshRejectedCount
public long getRefreshRejectedCount()
Description copied from interface:CommonMetrics
Refresh submit failed. Happens if the loader executor has not enough available resources and rejects the refresh task.- Specified by:
getRefreshRejectedCount
in interfaceCommonMetrics
-
refreshRejected
public void refreshRejected()
- Specified by:
refreshRejected
in interfaceCommonMetrics.Updater
-
isDisabled
public boolean isDisabled()
Description copied from interface:CommonMetrics
True if statistics are disabled.- Specified by:
isDisabled
in interfaceCommonMetrics
-
getGoneSpinCount
public long getGoneSpinCount()
Description copied from interface:CommonMetrics
Entry was removed while waiting to get the mutation lock.- Specified by:
getGoneSpinCount
in interfaceCommonMetrics
- See Also:
InternalCacheInfo.getGoneSpinCount()
-
goneSpin
public void goneSpin()
- Specified by:
goneSpin
in interfaceCommonMetrics.Updater
-
-