Package org.infinispan.stats.impl
Class StatsCollector
- java.lang.Object
-
- org.infinispan.stats.impl.StatsCollector
-
- All Implemented Interfaces:
JmxStatisticsExposer
,Stats
public class StatsCollector extends Object implements Stats, JmxStatisticsExposer
- Author:
- Radim Vansa <rvansa@redhat.com>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StatsCollector.Factory
-
Constructor Summary
Constructors Constructor Description StatsCollector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.void
recordEviction()
void
recordEvictions(int evicted)
void
recordHits(int hits, long time)
void
recordMisses(int misses, long time)
void
recordRemoveHits(int removes, long time)
void
recordRemoveMisses(int removes)
void
recordStores(int stores, long time)
void
reset()
Reset statisticsvoid
resetStatistics()
Resets an interceptor's cache statisticsvoid
setStatisticsEnabled(boolean enabled)
Enables or disables statistics at runtime.void
start()
-
-
-
Method Detail
-
start
public void start()
-
getHits
public long getHits()
-
getMisses
public long getMisses()
-
getRemoveHits
public long getRemoveHits()
- Specified by:
getRemoveHits
in interfaceStats
- Returns:
- Number of cache removal hits.
-
getRemoveMisses
public long getRemoveMisses()
- Specified by:
getRemoveMisses
in interfaceStats
- Returns:
- Number of cache removal misses.
-
getStores
public long getStores()
-
getRetrievals
public long getRetrievals()
- Specified by:
getRetrievals
in interfaceStats
- Returns:
- Number of get operations.
-
getEvictions
public long getEvictions()
- Specified by:
getEvictions
in interfaceStats
- Returns:
- Number of cache eviction.
-
getHitRatio
public double getHitRatio()
-
getReadWriteRatio
public double getReadWriteRatio()
-
getAverageReadTime
public long getAverageReadTime()
- Specified by:
getAverageReadTime
in interfaceStats
- Returns:
- Average number of milliseconds for a cache get on the cache
-
getAverageReadTimeNanos
public long getAverageReadTimeNanos()
- Specified by:
getAverageReadTimeNanos
in interfaceStats
- Returns:
- Average number of nanoseconds for a cache get on the cache
-
getAverageWriteTime
public long getAverageWriteTime()
- Specified by:
getAverageWriteTime
in interfaceStats
- Returns:
- Average number of milliseconds for a cache put on the cache
-
getAverageWriteTimeNanos
public long getAverageWriteTimeNanos()
- Specified by:
getAverageWriteTimeNanos
in interfaceStats
- Returns:
- Average number of milliseconds for a cache put on the cache
-
getAverageRemoveTime
public long getAverageRemoveTime()
- Specified by:
getAverageRemoveTime
in interfaceStats
- Returns:
- Average number of milliseconds for a cache remove on the cache
-
getAverageRemoveTimeNanos
public long getAverageRemoveTimeNanos()
- Specified by:
getAverageRemoveTimeNanos
in interfaceStats
- Returns:
- Average number of nanoseconds for a cache remove on the cache
-
getRequiredMinimumNumberOfNodes
public int getRequiredMinimumNumberOfNodes()
- Specified by:
getRequiredMinimumNumberOfNodes
in interfaceStats
- Returns:
- Required minimum number of nodes to guarantee data consistency
-
reset
public void reset()
Description copied from interface:Stats
Reset statistics
-
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
-
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
-
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
-
getTimeSinceStart
public long getTimeSinceStart()
- Specified by:
getTimeSinceStart
in interfaceStats
- Returns:
- Number of seconds since cache started.
-
getTimeSinceReset
public long getTimeSinceReset()
- Specified by:
getTimeSinceReset
in interfaceStats
- Returns:
- Number of seconds since stats where reset
-
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
-
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:
-
resetStatistics
public void resetStatistics()
Description copied from interface:JmxStatisticsExposer
Resets an interceptor's cache statistics- Specified by:
resetStatistics
in interfaceJmxStatisticsExposer
-
recordMisses
public void recordMisses(int misses, long time)
-
recordHits
public void recordHits(int hits, long time)
-
recordEviction
public void recordEviction()
-
recordEvictions
public void recordEvictions(int evicted)
-
recordStores
public void recordStores(int stores, long time)
-
recordRemoveHits
public void recordRemoveHits(int removes, long time)
-
recordRemoveMisses
public void recordRemoveMisses(int removes)
-
-