Class StatsImpl

java.lang.Object
org.infinispan.stats.impl.StatsImpl
All Implemented Interfaces:
JsonSerialization, Stats

@Immutable public class StatsImpl extends Object implements Stats
StatsImpl.
Since:
4.0
Author:
Galder ZamarreƱo
  • Method Details

    • 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 from StatsCollector.
      Parameters:
      collector -
      Returns:
    • getTimeSinceStart

      public long getTimeSinceStart()
      Specified by:
      getTimeSinceStart in interface Stats
      Returns:
      Number of seconds since cache started.
    • getTimeSinceReset

      public long getTimeSinceReset()
      Specified by:
      getTimeSinceReset in interface Stats
      Returns:
      Number of seconds since stats where reset
    • getApproximateEntries

      public long getApproximateEntries()
      Description copied from interface: Stats
      Returns 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:
      getApproximateEntries in interface Stats
      Returns:
      Number of entries currently in the cache, including passivated entries.
    • getApproximateEntriesInMemory

      public long getApproximateEntriesInMemory()
      Description copied from interface: Stats
      The same as Stats.getApproximateEntries(), however passivated entries are not included.
      Specified by:
      getApproximateEntriesInMemory in interface Stats
    • getApproximateEntriesUnique

      public long getApproximateEntriesUnique()
      Description copied from interface: Stats
      The same as Stats.getApproximateEntries(), however only entries owned as primary are counted. This is only different from Stats.getApproximateEntries() only in distributed and replicated caches.
      Specified by:
      getApproximateEntriesUnique in interface Stats
    • 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 interface Stats
      Returns:
      Number of entries currently in the cache, including passivated entries.
    • getCurrentNumberOfEntriesInMemory

      public int getCurrentNumberOfEntriesInMemory()
      Description copied from interface: Stats
      The same as Stats.getCurrentNumberOfEntries(), however passivated entries are not included.
      Specified by:
      getCurrentNumberOfEntriesInMemory in interface Stats
    • getTotalNumberOfEntries

      @Deprecated(forRemoval=true) public long getTotalNumberOfEntries()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Stats
      Number of entries stored in cache since the cache started running.
      Specified by:
      getTotalNumberOfEntries in interface Stats
    • 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 -1.
      Specified by:
      getDataMemoryUsed in interface Stats
      Returns:
      memory in use or -1 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, or -1 if the cache stores data in the heap.
      Specified by:
      getOffHeapMemoryUsed in interface Stats
    • getRetrievals

      public long getRetrievals()
      Specified by:
      getRetrievals in interface Stats
      Returns:
      Number of entries read from the cache since start.
    • getStores

      public long getStores()
      Specified by:
      getStores in interface Stats
      Returns:
      Number of entries stored in cache since start.
    • getHits

      public long getHits()
      Specified by:
      getHits in interface Stats
      Returns:
      Number of cache get hits.
    • getMisses

      public long getMisses()
      Specified by:
      getMisses in interface Stats
      Returns:
      Number of cache get misses.
    • getRemoveHits

      public long getRemoveHits()
      Specified by:
      getRemoveHits in interface Stats
      Returns:
      Number of cache removal hits.
    • getRemoveMisses

      public long getRemoveMisses()
      Specified by:
      getRemoveMisses in interface Stats
      Returns:
      Number of cache removal misses.
    • getEvictions

      public long getEvictions()
      Specified by:
      getEvictions in interface Stats
      Returns:
      Number of cache eviction.
    • getAverageReadTime

      public long getAverageReadTime()
      Specified by:
      getAverageReadTime in interface Stats
      Returns:
      Average number of milliseconds for a cache get on the cache
    • getAverageWriteTime

      public long getAverageWriteTime()
      Specified by:
      getAverageWriteTime in interface Stats
      Returns:
      Average number of milliseconds for a cache put on the cache
    • getAverageRemoveTime

      public long getAverageRemoveTime()
      Specified by:
      getAverageRemoveTime in interface Stats
      Returns:
      Average number of milliseconds for a cache remove on the cache
    • getAverageReadTimeNanos

      public long getAverageReadTimeNanos()
      Specified by:
      getAverageReadTimeNanos in interface Stats
      Returns:
      Average number of nanoseconds for a cache get on the cache
    • getAverageWriteTimeNanos

      public long getAverageWriteTimeNanos()
      Specified by:
      getAverageWriteTimeNanos in interface Stats
      Returns:
      Average number of milliseconds for a cache put on the cache
    • getAverageRemoveTimeNanos

      public long getAverageRemoveTimeNanos()
      Specified by:
      getAverageRemoveTimeNanos in interface Stats
      Returns:
      Average number of nanoseconds for a cache remove on the cache
    • getRequiredMinimumNumberOfNodes

      public int getRequiredMinimumNumberOfNodes()
      Specified by:
      getRequiredMinimumNumberOfNodes in interface Stats
      Returns:
      Required minimum number of nodes to guarantee data consistency
    • reset

      public void reset()
      Description copied from interface: Stats
      Reset statistics
      Specified by:
      reset in interface Stats
    • setStatisticsEnabled

      public void setStatisticsEnabled(boolean enabled)
      Description copied from interface: Stats
      Enables or disables statistics at runtime.
      Specified by:
      setStatisticsEnabled in interface Stats
      Parameters:
      enabled - boolean indicating whether statistics should be enable or not