Package org.infinispan.stats.impl
Class StatsImpl
- java.lang.Object
-
- org.infinispan.stats.impl.StatsImpl
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Statscreate(Configuration configuration, AsyncInterceptorChain chain)Use this factory to create Stats object from configuration and the interceptor chain.static Statscreate(StatsCollector collector)Use this factory to create Stats object fromStatsCollector.longgetAverageReadTime()longgetAverageReadTimeNanos()longgetAverageRemoveTime()longgetAverageRemoveTimeNanos()longgetAverageWriteTime()longgetAverageWriteTimeNanos()intgetCurrentNumberOfEntries()Returns the number of entries currently in this cache instance.intgetCurrentNumberOfEntriesInMemory()The same asStats.getCurrentNumberOfEntries(), however passivated entries are not included.longgetDataMemoryUsed()Provides how much memory the current eviction algorithm estimates is in use for data.longgetEvictions()longgetHits()longgetMisses()longgetOffHeapMemoryUsed()The amount of off-heap memory used by this cachelonggetRemoveHits()longgetRemoveMisses()intgetRequiredMinimumNumberOfNodes()longgetRetrievals()longgetStores()longgetTimeSinceReset()longgetTimeSinceStart()longgetTotalNumberOfEntries()Number of entries stored in cache since the cache started running.voidreset()Reset statisticsvoidsetStatisticsEnabled(boolean enabled)Enables or disables statistics at runtime.
-
-
-
Method Detail
-
create
public static Stats create(Configuration configuration, AsyncInterceptorChain chain)
Use this factory to create Stats object from configuration and the interceptor chain.- Parameters:
configuration-chain-- Returns:
- Stats object
-
create
public static Stats create(StatsCollector collector)
Use this factory to create Stats object fromStatsCollector.- Parameters:
collector-- Returns:
-
getTimeSinceStart
public long getTimeSinceStart()
- Specified by:
getTimeSinceStartin interfaceStats- Returns:
- Number of seconds since cache started.
-
getTimeSinceReset
public long getTimeSinceReset()
- Specified by:
getTimeSinceResetin interfaceStats- Returns:
- Number of seconds since stats where reset
-
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.
-
getCurrentNumberOfEntriesInMemory
public int getCurrentNumberOfEntriesInMemory()
Description copied from interface:StatsThe same asStats.getCurrentNumberOfEntries(), however passivated entries are not included.- Specified by:
getCurrentNumberOfEntriesInMemoryin interfaceStats
-
getTotalNumberOfEntries
public long getTotalNumberOfEntries()
Description copied from interface:StatsNumber of entries stored in cache since the cache started running.- Specified by:
getTotalNumberOfEntriesin interfaceStats
-
getDataMemoryUsed
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 0.- Specified by:
getDataMemoryUsedin interfaceStats- Returns:
- memory in use or 0 if memory eviction is not enabled
-
getOffHeapMemoryUsed
public long getOffHeapMemoryUsed()
Description copied from interface:StatsThe amount of off-heap memory used by this cache- Specified by:
getOffHeapMemoryUsedin interfaceStats- Returns:
-
getRetrievals
public long getRetrievals()
- Specified by:
getRetrievalsin interfaceStats- Returns:
- Number of get operations.
-
getStores
public long getStores()
-
getHits
public long getHits()
-
getMisses
public long getMisses()
-
getRemoveHits
public long getRemoveHits()
- Specified by:
getRemoveHitsin interfaceStats- Returns:
- Number of cache removal hits.
-
getRemoveMisses
public long getRemoveMisses()
- Specified by:
getRemoveMissesin interfaceStats- Returns:
- Number of cache removal misses.
-
getEvictions
public long getEvictions()
- Specified by:
getEvictionsin interfaceStats- Returns:
- Number of cache eviction.
-
getAverageReadTime
public long getAverageReadTime()
- Specified by:
getAverageReadTimein interfaceStats- Returns:
- Average number of milliseconds for a cache get on the cache
-
getAverageWriteTime
public long getAverageWriteTime()
- Specified by:
getAverageWriteTimein interfaceStats- Returns:
- Average number of milliseconds for a cache put on the cache
-
getAverageRemoveTime
public long getAverageRemoveTime()
- Specified by:
getAverageRemoveTimein interfaceStats- Returns:
- Average number of milliseconds for a cache remove on the cache
-
getAverageReadTimeNanos
public long getAverageReadTimeNanos()
- Specified by:
getAverageReadTimeNanosin interfaceStats- Returns:
- Average number of nanoseconds for a cache get on the cache
-
getAverageWriteTimeNanos
public long getAverageWriteTimeNanos()
- Specified by:
getAverageWriteTimeNanosin interfaceStats- Returns:
- Average number of milliseconds for a cache put on the cache
-
getAverageRemoveTimeNanos
public long getAverageRemoveTimeNanos()
- Specified by:
getAverageRemoveTimeNanosin interfaceStats- Returns:
- Average number of nanoseconds for a cache remove on the cache
-
getRequiredMinimumNumberOfNodes
public int getRequiredMinimumNumberOfNodes()
- Specified by:
getRequiredMinimumNumberOfNodesin interfaceStats- Returns:
- Required minimum number of nodes to guarantee data consistency
-
reset
public void reset()
Description copied from interface:StatsReset statistics
-
setStatisticsEnabled
public void setStatisticsEnabled(boolean enabled)
Description copied from interface:StatsEnables or disables statistics at runtime.- Specified by:
setStatisticsEnabledin interfaceStats- Parameters:
enabled- boolean indicating whether statistics should be enable or not
-
-