Package org.infinispan.stats.impl
Class ClusterCacheStatsImpl
java.lang.Object
org.infinispan.stats.impl.AbstractClusterStats
org.infinispan.stats.impl.ClusterCacheStatsImpl
- All Implemented Interfaces:
JsonSerialization,JmxStatisticsExposer,ClusterCacheStats,Stats
@MBean(objectName="ClusterCacheStats",
description="General cluster statistics such as timings, hit/miss ratio, etc. for a cache.")
public class ClusterCacheStatsImpl
extends AbstractClusterStats
implements ClusterCacheStats
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longprotected longprotected longFields inherited from interface org.infinispan.stats.ClusterCacheStats
OBJECT_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonglongReturns the approximate number of entries in this cache that exist in memory or persistent storage.longThe same asStats.getApproximateEntries(), however passivated entries are not included.longThe same asStats.getApproximateEntries(), however only entries owned as primary are counted.longlonglonglonglonglonglonglongintReturns the number of entries currently in this cache instance.intThe same asStats.getCurrentNumberOfEntries(), however passivated entries are not included.longProvides how much memory the current eviction algorithm estimates is in use for data.longdoublelonggetHits()longlongintintintlongThe amount of off-heap memory used by this cache, or -1 if the cache stores data in the heap.longdoublelonglongintlonglongprotected NumberbooleanReturns whether an interceptor's statistics are being captured.longlonglonglongDeprecated, for removal: This API element is subject to removal in a future version.voidreset()Reset statisticsvoidResets an interceptor's cache statisticsvoidsetStaleStatsThreshold(long threshold) voidsetStaleStatsThreshold(long staleStatsThreshold) voidsetStatisticsEnabled(boolean enabled) Enables an interceptor's cache statistics If true, the interceptor will capture statistics and make them available through the mbean.voidstart()Methods inherited from class org.infinispan.stats.impl.AbstractClusterStats
getStaleStatsThreshold, getTimeSinceReset, isStatisticsEnabledMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.infinispan.stats.Stats
getTimeSinceReset, setStatisticsEnabled, toJson
-
Field Details
-
DEFAULT_STALE_STATS_THRESHOLD
public static final long DEFAULT_STALE_STATS_THRESHOLD- See Also:
-
staleStatsThreshold
protected volatile long staleStatsThreshold -
statsUpdateTimestamp
protected volatile long statsUpdateTimestamp
-
-
Constructor Details
-
ClusterCacheStatsImpl
public ClusterCacheStatsImpl()
-
-
Method Details
-
start
public void start() -
getAverageReadTime
@ManagedAttribute(description="Average number of milliseconds for a read operation on the cache across the cluster", displayName="Cluster-wide total average read time (ms)", units=MILLISECONDS, clusterWide=true) public long getAverageReadTime()- Specified by:
getAverageReadTimein interfaceStats- Returns:
- Average number of milliseconds for a cache get on the cache
-
getAverageReadTimeNanos
@ManagedAttribute(description="Average number of nanoseconds for a read operation on the cache across the cluster", displayName="Cluster-wide average read time (ns)", units=NANOSECONDS, clusterWide=true) public long getAverageReadTimeNanos()- Specified by:
getAverageReadTimeNanosin interfaceStats- Returns:
- Average number of nanoseconds for a cache get on the cache
-
getAverageRemoveTime
@ManagedAttribute(description="Average number of milliseconds for a remove operation in the cache across the cluster", displayName="Cluster-wide average remove time (ms)", units=MILLISECONDS, clusterWide=true) public long getAverageRemoveTime()- Specified by:
getAverageRemoveTimein interfaceStats- Returns:
- Average number of milliseconds for a cache remove on the cache
-
getAverageRemoveTimeNanos
@ManagedAttribute(description="Average number of nanoseconds for a remove operation in the cache across the cluster", displayName="Cluster-wide average remove time (ns)", units=NANOSECONDS, clusterWide=true) public long getAverageRemoveTimeNanos()- Specified by:
getAverageRemoveTimeNanosin interfaceStats- Returns:
- Average number of nanoseconds for a cache remove on the cache
-
getAverageWriteTime
@ManagedAttribute(description="Average number of milliseconds for a write operation in the cache across the cluster", displayName="Cluster-wide average write time (ms)", units=MILLISECONDS, clusterWide=true) public long getAverageWriteTime()- Specified by:
getAverageWriteTimein interfaceStats- Returns:
- Average number of milliseconds for a cache put on the cache
-
getAverageWriteTimeNanos
@ManagedAttribute(description="Average number of nanoseconds for a write operation in the cache across the cluster", displayName="Cluster-wide average write time (ns)", units=NANOSECONDS, clusterWide=true) public long getAverageWriteTimeNanos()- Specified by:
getAverageWriteTimeNanosin interfaceStats- Returns:
- Average number of milliseconds for a cache put on the cache
-
getRequiredMinimumNumberOfNodes
@ManagedAttribute(description="Minimum number of nodes to avoid losing data", displayName="Required minimum number of nodes", clusterWide=true) public int getRequiredMinimumNumberOfNodes()- Specified by:
getRequiredMinimumNumberOfNodesin interfaceStats- Returns:
- Required minimum number of nodes to guarantee data consistency
-
getEvictions
@ManagedAttribute(description="Total number of cache eviction operations across the cluster", displayName="Cluster-wide total number of cache evictions", measurementType=TRENDSUP, clusterWide=true) public long getEvictions()- Specified by:
getEvictionsin interfaceStats- Returns:
- Number of cache eviction.
-
getHits
@ManagedAttribute(description="Total number of cache read hits across the cluster", displayName="Cluster-wide total number of cache read hits", measurementType=TRENDSUP, clusterWide=true) public long getHits() -
getHitRatio
@ManagedAttribute(description="Percentage hit/(hit+miss) ratio for this cache", displayName="Cluster-wide hit ratio", units=PERCENTAGE, clusterWide=true) public double getHitRatio()- Specified by:
getHitRatioin interfaceClusterCacheStats- Returns:
- cluster wide total percentage hit/(hit+miss) ratio for this cache
-
getMisses
@ManagedAttribute(description="Total number of cache read misses", displayName="Cluster-wide number of cache read misses", measurementType=TRENDSUP, clusterWide=true) public long getMisses() -
getApproximateEntries
@ManagedAttribute(description="Approximate number of entry replicas in the cache across the cluster, including passivated entries", displayName="Cluster-wide approximate number of entry replicas", clusterWide=true) public long getApproximateEntries()Description copied from interface:StatsReturns the approximate number of entries in this cache that exist in memory or persistent storage. When the cache is configured with distribution, this method only returns the number of entries in the local cache instance. In other words, it does not communicate with other nodes to find out about data stored in the cluster and not available locally.- Specified by:
getApproximateEntriesin interfaceClusterCacheStats- Specified by:
getApproximateEntriesin interfaceStats- Returns:
- the approximate number of entries. Each owner's copy is counted separately, except entries in shared stores.
-
getApproximateEntriesInMemory
@ManagedAttribute(description="Approximate number of entry replicas in memory across the cluster", displayName="Cluster-wide approximate number of entry replicas in memory", clusterWide=true) public long getApproximateEntriesInMemory()Description copied from interface:StatsThe same asStats.getApproximateEntries(), however passivated entries are not included.- Specified by:
getApproximateEntriesInMemoryin interfaceClusterCacheStats- Specified by:
getApproximateEntriesInMemoryin interfaceStats- Returns:
- the approximate number of entries in memory. Each owner's copy is counted separately.
-
getApproximateEntriesUnique
@ManagedAttribute(description="Approximate number of unique entries in the cache across the cluster, ignoring duplicate replicas", displayName="Cluster-wide approximate number of unique entries", clusterWide=true) public long getApproximateEntriesUnique()Description copied from interface:StatsThe same asStats.getApproximateEntries(), however only entries owned as primary are counted. This is only different fromStats.getApproximateEntries()only in distributed and replicated caches.- Specified by:
getApproximateEntriesUniquein interfaceClusterCacheStats- Specified by:
getApproximateEntriesUniquein interfaceStats- Returns:
- the approximate number of unique entries.
-
getNumberOfEntries
@ManagedAttribute(description="Current number of entries in the cache across the cluster, including passivated entries", displayName="Cluster-wide number of current cache entries", clusterWide=true) public int getNumberOfEntries() -
getCurrentNumberOfEntriesInMemory
@ManagedAttribute(description="Current number of entries in memory across the cluster", displayName="Cluster-wide number of entries in memory", clusterWide=true) public int getCurrentNumberOfEntriesInMemory()Description copied from interface:StatsThe same asStats.getCurrentNumberOfEntries(), however passivated entries are not included.- Specified by:
getCurrentNumberOfEntriesInMemoryin interfaceStats
-
getReadWriteRatio
@ManagedAttribute(description="Cluster-wide read/writes ratio for the cache", displayName="Cluster-wide read/write ratio", units=PERCENTAGE, clusterWide=true) public double getReadWriteRatio()- Specified by:
getReadWriteRatioin interfaceClusterCacheStats- Returns:
- cluster wide read/writes ratio for the cache
-
getRemoveHits
@ManagedAttribute(description="Cluster-wide total number of cache removal hits", displayName="Cluster-wide total number of cache removal hits", measurementType=TRENDSUP, clusterWide=true) public long getRemoveHits()- Specified by:
getRemoveHitsin interfaceStats- Returns:
- Number of cache removal hits.
-
getRemoveMisses
@ManagedAttribute(description="Cluster-wide total number of cache removals where keys were not found", displayName="Cluster-wide total number of cache removal misses", measurementType=TRENDSUP, clusterWide=true) public long getRemoveMisses()- Specified by:
getRemoveMissesin interfaceStats- Returns:
- Number of cache removal misses.
-
getStores
@ManagedAttribute(description="Cluster-wide total number of cache put operations", displayName="Cluster-wide total number of cache puts", measurementType=TRENDSUP, clusterWide=true) public long getStores() -
getTimeSinceStart
@ManagedAttribute(description="Number of seconds since the first cache node started", displayName="Number of seconds since the first cache node started", measurementType=TRENDSUP, clusterWide=true) public long getTimeSinceStart()- Specified by:
getTimeSinceStartin interfaceStats- Returns:
- Number of seconds since cache started.
-
getCurrentNumberOfEntries
public int getCurrentNumberOfEntries()Description copied from interface:StatsReturns the number of entries currently in this cache instance. When the cache is configured with distribution, this method only returns the number of entries in the local cache instance. In other words, it does not attempt to communicate with other nodes to find out about the data stored in other nodes in the cluster that is not available locally.- Specified by:
getCurrentNumberOfEntriesin interfaceStats- Returns:
- Number of entries currently in the cache, including passivated entries.
-
getTotalNumberOfEntries
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:StatsNumber of entries stored in cache since the cache started running.- Specified by:
getTotalNumberOfEntriesin interfaceStats
-
getDataMemoryUsed
@ManagedAttribute(description="Amount in bytes of memory used across the cluster for entries in this cache with eviction", displayName="Cluster-wide memory used by eviction", clusterWide=true) public long getDataMemoryUsed()Description copied from interface:StatsProvides how much memory the current eviction algorithm estimates is in use for data. This method will return a number 0 or greater if memory eviction is in use. If memory eviction is not enabled this method will always return -1.- Specified by:
getDataMemoryUsedin interfaceStats- Returns:
- memory in use or -1 if memory eviction is not enabled
-
getOffHeapMemoryUsed
@ManagedAttribute(description="Amount in bytes of off-heap memory used across the cluster for this cache", displayName="Cluster-wide off-heap memory used", clusterWide=true) public long getOffHeapMemoryUsed()Description copied from interface:StatsThe amount of off-heap memory used by this cache, or -1 if the cache stores data in the heap.- Specified by:
getOffHeapMemoryUsedin interfaceStats
-
getRetrievals
public long getRetrievals()- Specified by:
getRetrievalsin interfaceStats- Returns:
- Number of entries read from the cache since start.
-
reset
public void reset()Description copied from interface:StatsReset statistics -
getNumberOfLocksAvailable
@ManagedAttribute(description="Current number of exclusive locks available across the cluster", displayName="Cluster-wide number of locks available", clusterWide=true) public int getNumberOfLocksAvailable()- Specified by:
getNumberOfLocksAvailablein interfaceClusterCacheStats- Returns:
- the total number of exclusive locks available in the cluster
-
getNumberOfLocksHeld
@ManagedAttribute(description="Current number of locks held across the cluster", displayName="Cluster-wide number of locks held", clusterWide=true) public int getNumberOfLocksHeld()- Specified by:
getNumberOfLocksHeldin interfaceClusterCacheStats- Returns:
- the total number of exclusive locks held in the cluster
-
getInvalidations
@ManagedAttribute(description="The total number of invalidations in the cluster", displayName="Cluster-wide total number of invalidations", measurementType=TRENDSUP, clusterWide=true) public long getInvalidations()- Specified by:
getInvalidationsin interfaceClusterCacheStats- Returns:
- the total number of invalidations in the cluster
-
getActivations
@ManagedAttribute(description="The total number of activations across the cluster", displayName="Cluster-wide total number of activations", measurementType=TRENDSUP, clusterWide=true) public long getActivations()- Specified by:
getActivationsin interfaceClusterCacheStats- Returns:
- the total number of activations in the cluster
-
getPassivations
@ManagedAttribute(description="The total number of passivations across the cluster", displayName="Cluster-wide total number of passivations", measurementType=TRENDSUP, clusterWide=true) public long getPassivations()- Specified by:
getPassivationsin interfaceClusterCacheStats- Returns:
- the total number of passivations in the cluster
-
getCacheLoaderLoads
@ManagedAttribute(description="The total number of persistence load operations in the cluster", displayName="Cluster-wide total number of persistence loads", measurementType=TRENDSUP, clusterWide=true) public long getCacheLoaderLoads()- Specified by:
getCacheLoaderLoadsin interfaceClusterCacheStats- Returns:
- the total number of persistence load operations in the cluster
-
getCacheLoaderMisses
@ManagedAttribute(description="The total number of cacheloader load misses in the cluster", displayName="Cluster-wide total number of cacheloader misses", measurementType=TRENDSUP, clusterWide=true) public long getCacheLoaderMisses()- Specified by:
getCacheLoaderMissesin interfaceClusterCacheStats- Returns:
- the total number of persistence misses in the cluster
-
getStoreWrites
@ManagedAttribute(description="The total number of cachestore store operations in the cluster", displayName="Cluster-wide total number of cachestore stores", measurementType=TRENDSUP, clusterWide=true) public long getStoreWrites()- Specified by:
getStoreWritesin interfaceClusterCacheStats- Returns:
- the total number of persistence store operations in the cluster
-
getStaleStatsThreshold
long getStaleStatsThreshold()- Returns:
- The time in milliseconds, to wait between requests before re-retrieving cluster wide stats
-
setStaleStatsThreshold
void setStaleStatsThreshold(long threshold) - Parameters:
threshold- the time in milliseconds, to wait between requests before re-retrieving cluster wide stats
-
resetStatistics
@ManagedOperation(description="Resets statistics gathered by this component", displayName="Reset statistics") public void resetStatistics()Description copied from interface:JmxStatisticsExposerResets an interceptor's cache statistics- Specified by:
resetStatisticsin interfaceJmxStatisticsExposer
-
setStatisticsEnabled
public void setStatisticsEnabled(boolean enabled) Description copied from interface:JmxStatisticsExposerEnables an interceptor's cache statistics If true, the interceptor will capture statistics and make them available through the mbean.- Specified by:
setStatisticsEnabledin interfaceJmxStatisticsExposer- Parameters:
enabled- true if statistics should be captured
-
getStatisticsEnabled
public boolean getStatisticsEnabled()Description copied from interface:JmxStatisticsExposerReturns whether an interceptor's statistics are being captured.- Specified by:
getStatisticsEnabledin interfaceJmxStatisticsExposer- Returns:
- true if statistics are captured
-
setStaleStatsThreshold
public void setStaleStatsThreshold(long staleStatsThreshold) -
getStat
-