Package org.infinispan.interceptors.impl
Class CacheMgmtInterceptor
java.lang.Object
org.infinispan.interceptors.BaseAsyncInterceptor
org.infinispan.interceptors.DDAsyncInterceptor
org.infinispan.interceptors.impl.JmxStatsCommandInterceptor
org.infinispan.interceptors.impl.CacheMgmtInterceptor
- All Implemented Interfaces:
Visitor,AsyncInterceptor,JmxStatisticsExposer
@MBean(objectName="Statistics",
description="General statistics such as timings, hit/miss ratio, and so on.")
public final class CacheMgmtInterceptor
extends JmxStatsCommandInterceptor
Captures cache management statistics.
- Since:
- 9.0
- Author:
- Jerry Gauthier
-
Field Summary
Fields inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
cacheConfiguration -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDataRead(boolean foundValue, long timeNanoSeconds) voidaddEvictions(long numEvictions) static intcalculateRequiredMinimumNumberOfNodes(AdvancedCache<?, ?> cache, ComponentRegistry componentRegistry) longlonglonglonglonglonglonglonglonglonglongDeprecated.longdoublelonggetHits()longintDeprecated.intDeprecated.longdoublelonglongintlonglonglongvoidResets statistics gathered.voidsetHitTimes(org.infinispan.commons.stat.TimerTracker hitTimes) voidsetMissTimes(org.infinispan.commons.stat.TimerTracker missTimes) voidsetRemoveTimes(org.infinispan.commons.stat.TimerTracker removeTimes) voidsetStoreTimes(org.infinispan.commons.stat.TimerTracker storeTimes) voidstart()visitComputeCommand(InvocationContext ctx, ComputeCommand command) visitEvictCommand(InvocationContext ctx, EvictCommand command) visitGetAllCommand(InvocationContext ctx, GetAllCommand command) final ObjectvisitGetCacheEntryCommand(InvocationContext ctx, GetCacheEntryCommand command) final ObjectvisitGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command) visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) visitPutMapCommand(InvocationContext ctx, PutMapCommand command) visitReadOnlyKeyCommand(InvocationContext ctx, ReadOnlyKeyCommand command) visitReadOnlyManyCommand(InvocationContext ctx, ReadOnlyManyCommand command) visitReadWriteKeyCommand(InvocationContext ctx, ReadWriteKeyCommand command) visitReadWriteManyCommand(InvocationContext ctx, ReadWriteManyCommand command) visitRemoveCommand(InvocationContext ctx, RemoveCommand command) visitReplaceCommand(InvocationContext ctx, ReplaceCommand command) visitWriteOnlyKeyCommand(InvocationContext ctx, WriteOnlyKeyCommand command) Methods inherited from class org.infinispan.interceptors.impl.JmxStatsCommandInterceptor
getStatisticsEnabled, onStart, setStatisticsEnabledMethods inherited from class org.infinispan.interceptors.DDAsyncInterceptor
handleDefault, visitClearCommand, visitCommand, visitCommitCommand, visitEntrySetCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitLockControlCommand, visitPrepareCommand, visitRollbackCommand, visitSizeCommand, visitTouchCommand, visitUnknownCommand, visitWriteOnlyManyCommand, visitWriteOnlyManyEntriesCommandMethods inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
asyncInvokeNext, asyncInvokeNext, asyncInvokeNext, asyncValue, delayedNull, delayedValue, delayedValue, invokeNext, invokeNextAndExceptionally, invokeNextAndFinally, invokeNextAndHandle, invokeNextThenAccept, invokeNextThenApply, isSuccessfullyDone, makeStage, setNextInterceptor, valueOrExceptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.infinispan.commands.Visitor
visitRemoveExpiredCommand
-
Constructor Details
-
CacheMgmtInterceptor
public CacheMgmtInterceptor()
-
-
Method Details
-
start
public void start() -
setHitTimes
@ManagedAttribute(description="Hit Times", displayName="Hit Times", dataType=TIMER, units=NANOSECONDS) public void setHitTimes(org.infinispan.commons.stat.TimerTracker hitTimes) -
setMissTimes
@ManagedAttribute(description="Miss Times", displayName="Miss Times", dataType=TIMER, units=NANOSECONDS) public void setMissTimes(org.infinispan.commons.stat.TimerTracker missTimes) -
setStoreTimes
@ManagedAttribute(description="Store Times", displayName="Store Times", dataType=TIMER, units=NANOSECONDS) public void setStoreTimes(org.infinispan.commons.stat.TimerTracker storeTimes) -
setRemoveTimes
@ManagedAttribute(description="Remove Times", displayName="Remove Times", dataType=TIMER, units=NANOSECONDS) public void setRemoveTimes(org.infinispan.commons.stat.TimerTracker removeTimes) -
visitEvictCommand
- Specified by:
visitEvictCommandin interfaceVisitor- Overrides:
visitEvictCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitGetKeyValueCommand
- Specified by:
visitGetKeyValueCommandin interfaceVisitor- Overrides:
visitGetKeyValueCommandin classDDAsyncInterceptor
-
visitGetCacheEntryCommand
- Specified by:
visitGetCacheEntryCommandin interfaceVisitor- Overrides:
visitGetCacheEntryCommandin classDDAsyncInterceptor
-
addDataRead
public void addDataRead(boolean foundValue, long timeNanoSeconds) -
visitGetAllCommand
- Specified by:
visitGetAllCommandin interfaceVisitor- Overrides:
visitGetAllCommandin classDDAsyncInterceptor
-
visitPutMapCommand
- Specified by:
visitPutMapCommandin interfaceVisitor- Overrides:
visitPutMapCommandin classDDAsyncInterceptor
-
visitPutKeyValueCommand
- Specified by:
visitPutKeyValueCommandin interfaceVisitor- Overrides:
visitPutKeyValueCommandin classDDAsyncInterceptor
-
visitIracPutKeyValueCommand
public Object visitIracPutKeyValueCommand(InvocationContext ctx, IracPutKeyValueCommand command) throws Throwable - Specified by:
visitIracPutKeyValueCommandin interfaceVisitor- Overrides:
visitIracPutKeyValueCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitReplaceCommand
- Specified by:
visitReplaceCommandin interfaceVisitor- Overrides:
visitReplaceCommandin classDDAsyncInterceptor
-
visitComputeCommand
- Specified by:
visitComputeCommandin interfaceVisitor- Overrides:
visitComputeCommandin classDDAsyncInterceptor
-
visitComputeIfAbsentCommand
- Specified by:
visitComputeIfAbsentCommandin interfaceVisitor- Overrides:
visitComputeIfAbsentCommandin classDDAsyncInterceptor
-
visitReadOnlyKeyCommand
- Specified by:
visitReadOnlyKeyCommandin interfaceVisitor- Overrides:
visitReadOnlyKeyCommandin classDDAsyncInterceptor
-
visitReadOnlyManyCommand
- Specified by:
visitReadOnlyManyCommandin interfaceVisitor- Overrides:
visitReadOnlyManyCommandin classDDAsyncInterceptor
-
visitWriteOnlyKeyCommand
- Specified by:
visitWriteOnlyKeyCommandin interfaceVisitor- Overrides:
visitWriteOnlyKeyCommandin classDDAsyncInterceptor
-
visitReadWriteKeyValueCommand
public Object visitReadWriteKeyValueCommand(InvocationContext ctx, ReadWriteKeyValueCommand command) - Specified by:
visitReadWriteKeyValueCommandin interfaceVisitor- Overrides:
visitReadWriteKeyValueCommandin classDDAsyncInterceptor
-
visitReadWriteKeyCommand
- Specified by:
visitReadWriteKeyCommandin interfaceVisitor- Overrides:
visitReadWriteKeyCommandin classDDAsyncInterceptor
-
visitWriteOnlyKeyValueCommand
public Object visitWriteOnlyKeyValueCommand(InvocationContext ctx, WriteOnlyKeyValueCommand command) - Specified by:
visitWriteOnlyKeyValueCommandin interfaceVisitor- Overrides:
visitWriteOnlyKeyValueCommandin classDDAsyncInterceptor
-
visitReadWriteManyCommand
- Specified by:
visitReadWriteManyCommandin interfaceVisitor- Overrides:
visitReadWriteManyCommandin classDDAsyncInterceptor
-
visitReadWriteManyEntriesCommand
public Object visitReadWriteManyEntriesCommand(InvocationContext ctx, ReadWriteManyEntriesCommand command) - Specified by:
visitReadWriteManyEntriesCommandin interfaceVisitor- Overrides:
visitReadWriteManyEntriesCommandin classDDAsyncInterceptor
-
visitRemoveCommand
- Specified by:
visitRemoveCommandin interfaceVisitor- Overrides:
visitRemoveCommandin classDDAsyncInterceptor
-
getHits
@ManagedAttribute(description="Number of cache attribute hits", displayName="Number of cache hits", measurementType=TRENDSUP) public long getHits() -
getMisses
@ManagedAttribute(description="Number of cache attribute misses", displayName="Number of cache misses", measurementType=TRENDSUP) public long getMisses() -
getRemoveHits
@ManagedAttribute(description="Number of cache removal hits", displayName="Number of cache removal hits", measurementType=TRENDSUP) public long getRemoveHits() -
getRemoveMisses
@ManagedAttribute(description="Number of cache removals where keys were not found", displayName="Number of cache removal misses", measurementType=TRENDSUP) public long getRemoveMisses() -
getStores
@ManagedAttribute(description="Number of cache attribute put operations", displayName="Number of cache puts", measurementType=TRENDSUP) public long getStores() -
getEvictions
@ManagedAttribute(description="Number of cache eviction operations", displayName="Number of cache evictions", measurementType=TRENDSUP) public long getEvictions() -
getHitRatio
@ManagedAttribute(description="Percentage hit/(hit+miss) ratio for the cache", displayName="Hit ratio", units=PERCENTAGE) public double getHitRatio() -
getReadWriteRatio
@ManagedAttribute(description="Read/writes ratio for the cache", displayName="Read/write ratio", units=PERCENTAGE) public double getReadWriteRatio() -
getAverageReadTime
@ManagedAttribute(description="Average number of milliseconds for a read operation on the cache", displayName="Average read time", units=MILLISECONDS) public long getAverageReadTime() -
getAverageReadTimeNanos
@ManagedAttribute(description="Average number of nanoseconds for a read operation on the cache", displayName="Average read time", units=NANOSECONDS) public long getAverageReadTimeNanos() -
getAverageWriteTime
@ManagedAttribute(description="Average number of milliseconds for a write operation in the cache", displayName="Average write time", units=MILLISECONDS) public long getAverageWriteTime() -
getAverageWriteTimeNanos
@ManagedAttribute(description="Average number of nanoseconds for a write operation in the cache", displayName="Average write time", units=NANOSECONDS) public long getAverageWriteTimeNanos() -
getAverageRemoveTime
@ManagedAttribute(description="Average number of milliseconds for a remove operation in the cache", displayName="Average remove time", units=MILLISECONDS) public long getAverageRemoveTime() -
getAverageRemoveTimeNanos
@ManagedAttribute(description="Average number of nanoseconds for a remove operation in the cache", displayName="Average remove time", units=NANOSECONDS) public long getAverageRemoveTimeNanos() -
getApproximateEntries
@ManagedAttribute(description="Approximate number of entries currently in the cache, including persisted and expired entries", displayName="Approximate number of entries") public long getApproximateEntries() -
getApproximateEntriesInMemory
@ManagedAttribute(description="Approximate number of entries currently in memory, including expired entries", displayName="Approximate number of cache entries in memory") public long getApproximateEntriesInMemory() -
getApproximateEntriesUnique
@ManagedAttribute(description="Approximate number of entries currently in the cache for which the local node is a primary owner, including persisted and expired entries", displayName="Approximate number of entries owned as primary") public long getApproximateEntriesUnique() -
getNumberOfEntries
@ManagedAttribute(description="Number of entries in the cache including passivated entries", displayName="Number of current cache entries") @Deprecated public int getNumberOfEntries()Deprecated. -
getNumberOfEntriesInMemory
@ManagedAttribute(description="Number of entries currently in-memory excluding expired entries", displayName="Number of in-memory cache entries") @Deprecated public int getNumberOfEntriesInMemory()Deprecated. -
getDataMemoryUsed
@ManagedAttribute(description="Amount of memory in bytes allocated for use in eviction for data in the cache", displayName="Memory used by data in the cache") public long getDataMemoryUsed() -
getOffHeapMemoryUsed
@ManagedAttribute(description="Amount off-heap memory used by this cache (bytes)", displayName="Off-Heap memory used") public long getOffHeapMemoryUsed() -
getRequiredMinimumNumberOfNodes
@ManagedAttribute(description="Amount of nodes required to guarantee data consistency", displayName="Required Minimum Nodes") public int getRequiredMinimumNumberOfNodes() -
calculateRequiredMinimumNumberOfNodes
public static int calculateRequiredMinimumNumberOfNodes(AdvancedCache<?, ?> cache, ComponentRegistry componentRegistry) -
getTimeSinceStart
@ManagedAttribute(description="Number of seconds since cache started", displayName="Seconds since cache started", units=SECONDS, measurementType=TRENDSUP) public long getTimeSinceStart() -
getElapsedTime
@ManagedAttribute(description="Number of seconds since cache started", displayName="Seconds since cache started", units=SECONDS, measurementType=TRENDSUP) @Deprecated public long getElapsedTime()Deprecated.usegetTimeSinceStart()instead.Returns number of seconds since cache started- Returns:
- number of seconds since cache started
-
getTimeSinceReset
@ManagedAttribute(description="Number of seconds since the cache statistics were last reset", displayName="Seconds since cache statistics were reset", units=SECONDS) public long getTimeSinceReset() -
resetStatistics
public void resetStatistics()Description copied from class:JmxStatsCommandInterceptorResets statistics gathered. Is a no-op, and should be overridden if it is to be meaningful.- Specified by:
resetStatisticsin interfaceJmxStatisticsExposer- Overrides:
resetStatisticsin classJmxStatsCommandInterceptor
-
addEvictions
public void addEvictions(long numEvictions)
-
getTimeSinceStart()instead.