Package org.infinispan.stats.impl
Class CacheContainerStatsImpl
- java.lang.Object
-
- org.infinispan.stats.impl.CacheContainerStatsImpl
-
- All Implemented Interfaces:
JmxStatisticsExposer
,CacheContainerStats
,Stats
public class CacheContainerStatsImpl extends Object implements CacheContainerStats, JmxStatisticsExposer
Cache container statistics needed for admin console- Since:
- 7.1
- Author:
- Vladimir Blagojevic
-
-
Field Summary
-
Fields inherited from interface org.infinispan.stats.CacheContainerStats
OBJECT_NAME
-
-
Constructor Summary
Constructors Constructor Description CacheContainerStatsImpl(EmbeddedCacheManager cm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected long
calculateAverageReadTime()
protected long
calculateAverageReadTimeNanos()
protected long
calculateAverageRemoveTime()
protected long
calculateAverageRemoveTimeNanos()
protected long
calculateAverageWriteTime()
protected long
calculateAverageWriteTimeNanos()
protected long
calculateDataMemoryUsed()
protected long
calculateEvictions()
protected double
calculateHitRatio()
protected long
calculateHits()
protected long
calculateMisses()
protected long
calculateOffHeapUsed()
protected double
calculateReadWriteRatio()
protected long
calculateRemoveHits()
protected long
calculateRemoveMisses()
protected long
calculateStores()
protected long
calculateTimeSinceStart()
long
getAverageReadTime()
long
getAverageReadTimeNanos()
long
getAverageRemoveTime()
long
getAverageRemoveTimeNanos()
long
getAverageWriteTime()
long
getAverageWriteTimeNanos()
int
getCurrentNumberOfEntries()
Returns the number of entries currently in this cache instance.int
getCurrentNumberOfEntriesInMemory()
The same asStats.getCurrentNumberOfEntries()
, however passivated entries are not included.long
getDataMemoryUsed()
Provides how much memory the current eviction algorithm estimates is in use for data.long
getEvictions()
double
getHitRatio()
long
getHits()
long
getMisses()
int
getNumberOfEntries()
long
getOffHeapMemoryUsed()
The amount of off-heap memory used by this cachedouble
getReadWriteRatio()
long
getRemoveHits()
long
getRemoveMisses()
int
getRequiredMinimumNumberOfNodes()
long
getRetrievals()
boolean
getStatisticsEnabled()
Returns whether an interceptor's statistics are being captured.long
getStores()
long
getTimeSinceReset()
long
getTimeSinceStart()
long
getTotalNumberOfEntries()
Number of entries stored in cache since the cache started running.boolean
isStatisticsEnabled()
void
reset()
Reset statisticsvoid
resetStatistics()
Resets an interceptor's cache statisticsvoid
setStatisticsEnabled(boolean enabled)
Enables or disables statistics at runtime.void
start()
-
-
-
Constructor Detail
-
CacheContainerStatsImpl
public CacheContainerStatsImpl(EmbeddedCacheManager cm)
-
-
Method Detail
-
start
public void start()
-
setStatisticsEnabled
public void setStatisticsEnabled(boolean enabled)
Description copied from interface:Stats
Enables or disables statistics at runtime.- Specified by:
setStatisticsEnabled
in interfaceJmxStatisticsExposer
- Specified by:
setStatisticsEnabled
in interfaceStats
- Parameters:
enabled
- boolean indicating whether statistics should be enable or not
-
getStatisticsEnabled
public boolean getStatisticsEnabled()
Description copied from interface:JmxStatisticsExposer
Returns whether an interceptor's statistics are being captured.- Specified by:
getStatisticsEnabled
in interfaceJmxStatisticsExposer
- Returns:
- true if statistics are captured
-
resetStatistics
public void resetStatistics()
Description copied from interface:JmxStatisticsExposer
Resets an interceptor's cache statistics- Specified by:
resetStatistics
in interfaceJmxStatisticsExposer
-
isStatisticsEnabled
public boolean isStatisticsEnabled()
-
getAverageReadTime
public long getAverageReadTime()
- Specified by:
getAverageReadTime
in interfaceStats
- Returns:
- Average number of milliseconds for a cache get on the cache
-
calculateAverageReadTime
protected long calculateAverageReadTime()
-
getAverageReadTimeNanos
public long getAverageReadTimeNanos()
- Specified by:
getAverageReadTimeNanos
in interfaceStats
- Returns:
- Average number of nanoseconds for a cache get on the cache
-
calculateAverageReadTimeNanos
protected long calculateAverageReadTimeNanos()
-
getRequiredMinimumNumberOfNodes
public int getRequiredMinimumNumberOfNodes()
- Specified by:
getRequiredMinimumNumberOfNodes
in interfaceStats
- Returns:
- Required minimum number of nodes to guarantee data consistency
-
getAverageRemoveTime
public long getAverageRemoveTime()
- Specified by:
getAverageRemoveTime
in interfaceStats
- Returns:
- Average number of milliseconds for a cache remove on the cache
-
calculateAverageRemoveTime
protected long calculateAverageRemoveTime()
-
getAverageRemoveTimeNanos
public long getAverageRemoveTimeNanos()
- Specified by:
getAverageRemoveTimeNanos
in interfaceStats
- Returns:
- Average number of nanoseconds for a cache remove on the cache
-
calculateAverageRemoveTimeNanos
protected long calculateAverageRemoveTimeNanos()
-
getAverageWriteTime
public long getAverageWriteTime()
- Specified by:
getAverageWriteTime
in interfaceStats
- Returns:
- Average number of milliseconds for a cache put on the cache
-
calculateAverageWriteTime
protected long calculateAverageWriteTime()
-
getAverageWriteTimeNanos
public long getAverageWriteTimeNanos()
- Specified by:
getAverageWriteTimeNanos
in interfaceStats
- Returns:
- Average number of milliseconds for a cache put on the cache
-
calculateAverageWriteTimeNanos
protected long calculateAverageWriteTimeNanos()
-
getEvictions
public long getEvictions()
- Specified by:
getEvictions
in interfaceStats
- Returns:
- Number of cache eviction.
-
calculateEvictions
protected long calculateEvictions()
-
getHits
public long getHits()
-
calculateHits
protected long calculateHits()
-
getHitRatio
public double getHitRatio()
- Specified by:
getHitRatio
in interfaceCacheContainerStats
-
calculateHitRatio
protected double calculateHitRatio()
-
getMisses
public long getMisses()
-
calculateMisses
protected long calculateMisses()
-
getNumberOfEntries
public int getNumberOfEntries()
-
getCurrentNumberOfEntriesInMemory
public int getCurrentNumberOfEntriesInMemory()
Description copied from interface:Stats
The same asStats.getCurrentNumberOfEntries()
, however passivated entries are not included.- Specified by:
getCurrentNumberOfEntriesInMemory
in interfaceStats
-
getReadWriteRatio
public double getReadWriteRatio()
- Specified by:
getReadWriteRatio
in interfaceCacheContainerStats
-
calculateReadWriteRatio
protected double calculateReadWriteRatio()
-
getRemoveHits
public long getRemoveHits()
- Specified by:
getRemoveHits
in interfaceStats
- Returns:
- Number of cache removal hits.
-
calculateRemoveHits
protected long calculateRemoveHits()
-
getRemoveMisses
public long getRemoveMisses()
- Specified by:
getRemoveMisses
in interfaceStats
- Returns:
- Number of cache removal misses.
-
calculateRemoveMisses
protected long calculateRemoveMisses()
-
getStores
public long getStores()
-
getTimeSinceReset
public long getTimeSinceReset()
- Specified by:
getTimeSinceReset
in interfaceStats
- Returns:
- Number of seconds since stats where reset
-
calculateStores
protected long calculateStores()
-
getTimeSinceStart
public long getTimeSinceStart()
- Specified by:
getTimeSinceStart
in interfaceStats
- Returns:
- Number of seconds since cache started.
-
calculateTimeSinceStart
protected long calculateTimeSinceStart()
-
getCurrentNumberOfEntries
public int getCurrentNumberOfEntries()
Description copied from interface:Stats
Returns 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:
getCurrentNumberOfEntries
in interfaceStats
- Returns:
- Number of entries currently in the cache, including passivated entries.
-
getTotalNumberOfEntries
public long getTotalNumberOfEntries()
Description copied from interface:Stats
Number of entries stored in cache since the cache started running.- Specified by:
getTotalNumberOfEntries
in interfaceStats
-
getDataMemoryUsed
public long getDataMemoryUsed()
Description copied from interface:Stats
Provides 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 0.- Specified by:
getDataMemoryUsed
in interfaceStats
- Returns:
- memory in use or 0 if memory eviction is not enabled
-
calculateDataMemoryUsed
protected long calculateDataMemoryUsed()
-
getOffHeapMemoryUsed
public long getOffHeapMemoryUsed()
Description copied from interface:Stats
The amount of off-heap memory used by this cache- Specified by:
getOffHeapMemoryUsed
in interfaceStats
- Returns:
-
calculateOffHeapUsed
protected long calculateOffHeapUsed()
-
getRetrievals
public long getRetrievals()
- Specified by:
getRetrievals
in interfaceStats
- Returns:
- Number of get operations.
-
-