Class CacheUsageInterceptor
- java.lang.Object
-
- org.infinispan.interceptors.BaseAsyncInterceptor
-
- org.infinispan.interceptors.DDAsyncInterceptor
-
- org.infinispan.interceptors.BaseCustomAsyncInterceptor
-
- org.infinispan.extendedstats.topK.CacheUsageInterceptor
-
- All Implemented Interfaces:
org.infinispan.commands.Visitor,org.infinispan.interceptors.AsyncInterceptor
@MBean(objectName="CacheUsageStatistics", description="Keeps tracks of the accessed keys") public class CacheUsageInterceptor extends org.infinispan.interceptors.BaseCustomAsyncInterceptorIntercepts the VisitableCommands to calculate the corresponding top-key values.- Since:
- 6.0
- Author:
- Pedro Ruivo
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_TOP_KEY
-
Constructor Summary
Constructors Constructor Description CacheUsageInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCapacity()Map<String,Long>getLocalTopGets()Map<String,Long>getLocalTopPuts()Map<String,Long>getNLocalTopGets(int n)Map<String,Long>getNLocalTopPuts(int n)Map<String,Long>getNRemoteTopGets(int n)Map<String,Long>getNRemoteTopPuts(int n)Map<String,Long>getNTopContendedKeys(int n)Map<String,Long>getNTopLockedKeys(int n)Map<String,Long>getNTopLockFailedKeys(int n)Map<String,Long>getNTopWriteSkewFailedKeys(int n)Map<String,Long>getRemoteTopGets()Map<String,Long>getRemoteTopPuts()Map<String,Long>getTopContendedKeys()Map<String,Long>getTopLockedKeys()Map<String,Long>getTopLockFailedKeys()Map<String,Long>getTopWriteSkewFailedKeys()voidresetStatistics()voidsetStatisticsEnabled(boolean enabled)voidsetTopKValue(int n)protected voidstart()protected voidstop()ObjectvisitGetAllCommand(org.infinispan.context.InvocationContext ctx, org.infinispan.commands.read.GetAllCommand command)ObjectvisitGetKeyValueCommand(org.infinispan.context.InvocationContext ctx, org.infinispan.commands.read.GetKeyValueCommand command)ObjectvisitPrepareCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.tx.PrepareCommand command)ObjectvisitPutKeyValueCommand(org.infinispan.context.InvocationContext ctx, org.infinispan.commands.write.PutKeyValueCommand command)-
Methods inherited from class org.infinispan.interceptors.DDAsyncInterceptor
handleDefault, visitClearCommand, visitCommand, visitCommitCommand, visitComputeCommand, visitComputeIfAbsentCommand, visitEntrySetCommand, visitEvictCommand, visitGetCacheEntryCommand, visitGetKeysInGroupCommand, visitInvalidateCommand, visitInvalidateL1Command, visitIracPutKeyValueCommand, visitKeySetCommand, visitLockControlCommand, visitPutMapCommand, visitReadOnlyKeyCommand, visitReadOnlyManyCommand, visitReadWriteKeyCommand, visitReadWriteKeyValueCommand, visitReadWriteManyCommand, visitReadWriteManyEntriesCommand, visitRemoveCommand, visitReplaceCommand, visitRollbackCommand, visitSizeCommand, visitTouchCommand, visitUnknownCommand, visitWriteOnlyKeyCommand, visitWriteOnlyKeyValueCommand, visitWriteOnlyManyCommand, visitWriteOnlyManyEntriesCommand
-
Methods inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
asyncInvokeNext, asyncInvokeNext, asyncInvokeNext, asyncValue, delayedNull, delayedValue, delayedValue, invokeNext, invokeNextAndExceptionally, invokeNextAndFinally, invokeNextAndHandle, invokeNextThenAccept, invokeNextThenApply, isSuccessfullyDone, makeStage, setNextInterceptor, valueOrException
-
-
-
-
Field Detail
-
DEFAULT_TOP_KEY
public static final int DEFAULT_TOP_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
visitGetKeyValueCommand
public Object visitGetKeyValueCommand(org.infinispan.context.InvocationContext ctx, org.infinispan.commands.read.GetKeyValueCommand command)
- Specified by:
visitGetKeyValueCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitGetKeyValueCommandin classorg.infinispan.interceptors.DDAsyncInterceptor
-
visitGetAllCommand
public Object visitGetAllCommand(org.infinispan.context.InvocationContext ctx, org.infinispan.commands.read.GetAllCommand command)
- Specified by:
visitGetAllCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitGetAllCommandin classorg.infinispan.interceptors.DDAsyncInterceptor
-
visitPutKeyValueCommand
public Object visitPutKeyValueCommand(org.infinispan.context.InvocationContext ctx, org.infinispan.commands.write.PutKeyValueCommand command)
- Specified by:
visitPutKeyValueCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitPutKeyValueCommandin classorg.infinispan.interceptors.DDAsyncInterceptor
-
visitPrepareCommand
public Object visitPrepareCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.tx.PrepareCommand command)
- Specified by:
visitPrepareCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitPrepareCommandin classorg.infinispan.interceptors.DDAsyncInterceptor
-
resetStatistics
@ManagedOperation(description="Resets statistics gathered by this component", displayName="Reset Statistics (Statistics)") public void resetStatistics()
-
setTopKValue
@ManagedOperation(description="Set K for the top-K values", displayName="Set capacity") public void setTopKValue(@Parameter(name="n",description="the n-th top key to collect") int n)
-
getCapacity
@ManagedAttribute(description="Shows the current capacity for top-K values", displayName="getCapacity") public int getCapacity()
-
getRemoteTopGets
@ManagedAttribute(description="Show the top 10 keys most read remotely by this instance", displayName="Top Remote Read Keys") public Map<String,Long> getRemoteTopGets()
-
getNRemoteTopGets
@ManagedOperation(description="Show the top n keys most read remotely by this instance", displayName="Nth Top Remote Read Keys") public Map<String,Long> getNRemoteTopGets(@Parameter(name="n",description="the n-th top key to return") int n)
-
getLocalTopGets
@ManagedAttribute(description="Show the top 10 keys most read locally by this instance", displayName="Top Local Read Keys") public Map<String,Long> getLocalTopGets()
-
getNLocalTopGets
@ManagedOperation(description="Show the top n keys most read locally by this instance", displayName="Nth Top Local Read Keys") public Map<String,Long> getNLocalTopGets(@Parameter(name="n",description="the n-th top key to return") int n)
-
getRemoteTopPuts
@ManagedAttribute(description="Show the top 10 keys most write remotely by this instance", displayName="Top Remote Write Keys") public Map<String,Long> getRemoteTopPuts()
-
getNRemoteTopPuts
@ManagedOperation(description="Show the top n keys most write remotely by this instance", displayName="Nth Top Remote Write Keys") public Map<String,Long> getNRemoteTopPuts(@Parameter(name="n",description="the n-th top key to return") int n)
-
getLocalTopPuts
@ManagedAttribute(description="Show the top 10 keys most write locally by this instance", displayName="Top Local Write Keys") public Map<String,Long> getLocalTopPuts()
-
getNLocalTopPuts
@ManagedOperation(description="Show the top n keys most write locally by this instance", displayName="Nth Top Local Write Keys") public Map<String,Long> getNLocalTopPuts(@Parameter(name="n",description="the n-th top key to return") int n)
-
getTopLockedKeys
@ManagedAttribute(description="Show the top 10 keys most locked", displayName="Top Locked Keys") public Map<String,Long> getTopLockedKeys()
-
getNTopLockedKeys
@ManagedOperation(description="Show the top n keys most locked", displayName="Nth Top Locked Keys") public Map<String,Long> getNTopLockedKeys(@Parameter(name="n",description="the n-th top key to return") int n)
-
getTopContendedKeys
@ManagedAttribute(description="Show the top 10 keys most contended", displayName="Top Contended Keys") public Map<String,Long> getTopContendedKeys()
-
getNTopContendedKeys
@ManagedOperation(description="Show the top n keys most contended", displayName="Nth Top Contended Keys") public Map<String,Long> getNTopContendedKeys(@Parameter(name="n",description="the n-th top key to return") int n)
-
getTopLockFailedKeys
@ManagedAttribute(description="Show the top 10 keys whose lock acquisition failed by timeout", displayName="Top Keys whose Lock Acquisition Failed by Timeout") public Map<String,Long> getTopLockFailedKeys()
-
getNTopLockFailedKeys
@ManagedOperation(description="Show the top n keys whose lock acquisition failed ", displayName="Nth Top Keys whose Lock Acquisition Failed by Timeout") public Map<String,Long> getNTopLockFailedKeys(@Parameter(name="n",description="the n-th top key to return") int n)
-
getTopWriteSkewFailedKeys
@ManagedAttribute(description="Show the top 10 keys whose write skew check was failed", displayName="Top Keys whose Write Skew Check was failed") public Map<String,Long> getTopWriteSkewFailedKeys()
-
getNTopWriteSkewFailedKeys
@ManagedOperation(description="Show the top n keys whose write skew check was failed", displayName="Nth Top Keys whose Write Skew Check was failed") public Map<String,Long> getNTopWriteSkewFailedKeys(@Parameter(name="n",description="the n-th top key to return") int n)
-
setStatisticsEnabled
@ManagedOperation(description="Show the top n keys whose write skew check was failed", displayName="Top Keys whose Write Skew Check was failed") public void setStatisticsEnabled(@Parameter(name="enabled",description="true to enable the top-k collection") boolean enabled)
-
start
protected void start()
- Overrides:
startin classorg.infinispan.interceptors.BaseCustomAsyncInterceptor
-
stop
protected void stop()
- Overrides:
stopin classorg.infinispan.interceptors.BaseCustomAsyncInterceptor
-
-