Class ContextJCacheStatistics

java.lang.Object
com.tangosol.coherence.jcache.common.AbstractJCacheStatistics
com.tangosol.coherence.jcache.common.ContextJCacheStatistics
All Implemented Interfaces:
JCacheStatistics, ExternalizableLite, PortableObject, Serializable, javax.cache.management.CacheStatisticsMXBean

public class ContextJCacheStatistics extends AbstractJCacheStatistics implements JCacheStatistics, ExternalizableLite, PortableObject
JCache Statistics implementation. JCache cache statistics differed enough from current Coherence cache statistics that just ended up maintaining statistics separately. Examples of differences include put of same value is optimized in Coherence implementation but JCache considers them 2 distinct puts. (could not pass jsr 107 tck with that behavior) Additionally, coherence does not count removals at the time this was written.
Since:
Coherence 12.1.3
Author:
jf 2013.10.24
See Also:
  • Constructor Details

    • ContextJCacheStatistics

      public ContextJCacheStatistics()
      Constructs ...
    • ContextJCacheStatistics

      public ContextJCacheStatistics(JCacheIdentifier id)
      Constructs JCacheStatistics for cache id
      Parameters:
      id - unique JCache cache identifier
  • Method Details

    • registerHits

      public void registerHits(int count, long lStartMillis)
      Description copied from interface: JCacheStatistics
      add Cache Hits of count and compute time in cache hits
      Specified by:
      registerHits in interface JCacheStatistics
      Parameters:
      count - number of cache entry lookup hits
      lStartMillis - start time in milliseconds for computing time performing lookup when there were hits.
    • registerMisses

      public void registerMisses(int count, long lStartMillis)
      Description copied from interface: JCacheStatistics
      add Cache Misses of count and compute time in cache misses
      Specified by:
      registerMisses in interface JCacheStatistics
      Parameters:
      count - number of cache entry lookup misses
      lStartMillis - start time of cache entry lookup that resulted in misses
    • registerPuts

      public void registerPuts(long count, long lStartMillis)
      Description copied from interface: JCacheStatistics
      add Cache Puts of count and compute time in cache puts
      Specified by:
      registerPuts in interface JCacheStatistics
      Parameters:
      count - number of cache entry puts
      lStartMillis - start time in milliseconds of put(s) operation
    • registerPutsCompleted

      public void registerPutsCompleted(long lStartMillis)
      Description copied from interface: JCacheStatistics
      Record elapsed time performing puts
      Specified by:
      registerPutsCompleted in interface JCacheStatistics
      Parameters:
      lStartMillis - start time in milliseconds of put(s) operation
    • registerRemoves

      public void registerRemoves(long count, long lStartMillis)
      Description copied from interface: JCacheStatistics
      add Cache Removals of count and compute time in cache removals
      Specified by:
      registerRemoves in interface JCacheStatistics
      Parameters:
      count - number of cache entry removals
      lStartMillis - start time in milliseconds of removal(s) operation
    • registerRemove

      public void registerRemove()
      Description copied from interface: JCacheStatistics
      register a Cache Remove
      Specified by:
      registerRemove in interface JCacheStatistics
    • registerHitsCompleted

      public void registerHitsCompleted(long lStartMillis)
      Description copied from interface: JCacheStatistics
      Record elapsed time in milliseconds performing hit(s)
      Specified by:
      registerHitsCompleted in interface JCacheStatistics
      Parameters:
      lStartMillis - start time in milliseconds of operation that resulted in a hit(s)
    • registerMissesCompleted

      public void registerMissesCompleted(long lStartMillis)
      Description copied from interface: JCacheStatistics
      Record elapsed time in milliseconds performing miss(es)
      Specified by:
      registerMissesCompleted in interface JCacheStatistics
      Parameters:
      lStartMillis - start time in milliseconds of operation that resulted in miss(es)
    • registerRemoveCompleted

      public void registerRemoveCompleted(long lStartMillis)
      Description copied from interface: JCacheStatistics
      Record elapsed time in milliseconds performing removal(s)
      Specified by:
      registerRemoveCompleted in interface JCacheStatistics
      Parameters:
      lStartMillis - start time in milliseconds of operation that resulted in removal(s)
    • getIdentifier

      public JCacheIdentifier getIdentifier()
      Description copied from interface: JCacheStatistics
      Get unique JCacheIdentifier for cache that these statistics are for.
      Specified by:
      getIdentifier in interface JCacheStatistics
      Returns:
      unique JCacheIdentifier
    • add

      public JCacheStatistics add(JCacheStatistics stats)
      Description copied from interface: JCacheStatistics
      add JCacheStatistics stats to this instance.
      Specified by:
      add in interface JCacheStatistics
      Parameters:
      stats - JCacheStatistics from another data-enabled server
      Returns:
      the addition of stats to this instance
    • getCacheHitsMillis

      public long getCacheHitsMillis()
      Description copied from interface: JCacheStatistics
      get time elapsed in milliseconds performing operations resulting in a hit
      Specified by:
      getCacheHitsMillis in interface JCacheStatistics
      Returns:
      duration of operations that resulted in cache entry hit
    • getCacheMissesMillis

      public long getCacheMissesMillis()
      Description copied from interface: JCacheStatistics
      get time elapsed in milliseconds performing operations resulting in a miss
      Specified by:
      getCacheMissesMillis in interface JCacheStatistics
      Returns:
      duration of operations that resulted in cache entry miss
    • getCachePutsMillis

      public long getCachePutsMillis()
      Description copied from interface: JCacheStatistics
      get time elapsed in milliseconds performing operations resulting in a put
      Specified by:
      getCachePutsMillis in interface JCacheStatistics
      Returns:
      duration of operations that resulted in cache entry put
    • getCacheRemoveMillis

      public long getCacheRemoveMillis()
      Description copied from interface: JCacheStatistics
      get time elapsed in milliseconds performing operations resulting in a remove
      Specified by:
      getCacheRemoveMillis in interface JCacheStatistics
      Returns:
      duration of operations that resulted in cache entry remove
    • clear

      public void clear()
      Specified by:
      clear in interface javax.cache.management.CacheStatisticsMXBean
      Specified by:
      clear in interface JCacheStatistics
    • getCacheHits

      public long getCacheHits()
      Specified by:
      getCacheHits in interface javax.cache.management.CacheStatisticsMXBean
      Specified by:
      getCacheHits in interface JCacheStatistics
    • getCacheHitPercentage

      public float getCacheHitPercentage()
      Specified by:
      getCacheHitPercentage in interface javax.cache.management.CacheStatisticsMXBean
      Specified by:
      getCacheHitPercentage in interface JCacheStatistics
    • getCacheMisses

      public long getCacheMisses()
      Specified by:
      getCacheMisses in interface javax.cache.management.CacheStatisticsMXBean
      Specified by:
      getCacheMisses in interface JCacheStatistics
    • getCacheMissPercentage

      public float getCacheMissPercentage()
      Specified by:
      getCacheMissPercentage in interface javax.cache.management.CacheStatisticsMXBean
      Specified by:
      getCacheMissPercentage in interface JCacheStatistics
    • getCacheGets

      public long getCacheGets()
      Specified by:
      getCacheGets in interface javax.cache.management.CacheStatisticsMXBean
      Specified by:
      getCacheGets in interface JCacheStatistics
    • getCachePuts

      public long getCachePuts()
      Specified by:
      getCachePuts in interface javax.cache.management.CacheStatisticsMXBean
      Specified by:
      getCachePuts in interface JCacheStatistics
    • getCacheRemovals

      public long getCacheRemovals()
      Specified by:
      getCacheRemovals in interface javax.cache.management.CacheStatisticsMXBean
      Specified by:
      getCacheRemovals in interface JCacheStatistics
    • getCacheEvictions

      public long getCacheEvictions()
      Specified by:
      getCacheEvictions in interface javax.cache.management.CacheStatisticsMXBean
      Specified by:
      getCacheEvictions in interface JCacheStatistics
    • getAverageGetTime

      public float getAverageGetTime()
      Specified by:
      getAverageGetTime in interface javax.cache.management.CacheStatisticsMXBean
      Specified by:
      getAverageGetTime in interface JCacheStatistics
    • getAveragePutTime

      public float getAveragePutTime()
      Specified by:
      getAveragePutTime in interface javax.cache.management.CacheStatisticsMXBean
      Specified by:
      getAveragePutTime in interface JCacheStatistics
    • getAverageRemoveTime

      public float getAverageRemoveTime()
      Specified by:
      getAverageRemoveTime in interface javax.cache.management.CacheStatisticsMXBean
      Specified by:
      getAverageRemoveTime in interface JCacheStatistics
    • readExternal

      public void readExternal(PofReader in) throws IOException
      Description copied from interface: PortableObject
      Restore the contents of a user type instance by reading its state using the specified PofReader object.
      Specified by:
      readExternal in interface PortableObject
      Parameters:
      in - the PofReader from which to read the object's state
      Throws:
      IOException - if an I/O error occurs
    • writeExternal

      public void writeExternal(PofWriter out) throws IOException
      Description copied from interface: PortableObject
      Save the contents of a POF user type instance by writing its state using the specified PofWriter object.
      Specified by:
      writeExternal in interface PortableObject
      Parameters:
      out - the PofWriter to which to write the object's state
      Throws:
      IOException - if an I/O error occurs
    • readExternal

      public void readExternal(DataInput in) throws IOException
      Description copied from interface: ExternalizableLite
      Restore the contents of this object by loading the object's state from the passed DataInput object.
      Specified by:
      readExternal in interface ExternalizableLite
      Parameters:
      in - the DataInput stream to read data from in order to restore the state of this object
      Throws:
      IOException - if an I/O exception occurs
    • writeExternal

      public void writeExternal(DataOutput out) throws IOException
      Description copied from interface: ExternalizableLite
      Save the contents of this object by storing the object's state into the passed DataOutput object.
      Specified by:
      writeExternal in interface ExternalizableLite
      Parameters:
      out - the DataOutput stream to write the state of this object to
      Throws:
      IOException - if an I/O exception occurs