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 Summary
ConstructorsConstructorDescriptionConstructs ...Constructs JCacheStatistics for cacheid -
Method Summary
Modifier and TypeMethodDescriptionadd(JCacheStatistics stats) addJCacheStatisticsstats to this instance.voidclear()floatfloatfloatlonglongfloatlonglongget time elapsed in milliseconds performing operations resulting in a hitlonglongget time elapsed in milliseconds performing operations resulting in a missfloatlonglongget time elapsed in milliseconds performing operations resulting in a putlonglongget time elapsed in milliseconds performing operations resulting in a removeGet unique JCacheIdentifier for cache that these statistics are for.voidRestore the contents of a user type instance by reading its state using the specified PofReader object.voidRestore the contents of this object by loading the object's state from the passed DataInput object.voidregisterHits(int count, long lStartMillis) add Cache Hits of count and compute time in cache hitsvoidregisterHitsCompleted(long lStartMillis) Record elapsed time in milliseconds performing hit(s)voidregisterMisses(int count, long lStartMillis) add Cache Misses of count and compute time in cache missesvoidregisterMissesCompleted(long lStartMillis) Record elapsed time in milliseconds performing miss(es)voidregisterPuts(long count, long lStartMillis) add Cache Puts of count and compute time in cache putsvoidregisterPutsCompleted(long lStartMillis) Record elapsed time performing putsvoidregister a Cache RemovevoidregisterRemoveCompleted(long lStartMillis) Record elapsed time in milliseconds performing removal(s)voidregisterRemoves(long count, long lStartMillis) add Cache Removals of count and compute time in cache removalsvoidwriteExternal(PofWriter out) Save the contents of a POF user type instance by writing its state using the specified PofWriter object.voidwriteExternal(DataOutput out) Save the contents of this object by storing the object's state into the passed DataOutput object.Methods inherited from class com.tangosol.coherence.jcache.common.AbstractJCacheStatistics
toString
-
Constructor Details
-
ContextJCacheStatistics
public ContextJCacheStatistics()Constructs ... -
ContextJCacheStatistics
Constructs JCacheStatistics for cacheid- Parameters:
id- unique JCache cache identifier
-
-
Method Details
-
registerHits
public void registerHits(int count, long lStartMillis) Description copied from interface:JCacheStatisticsadd Cache Hits of count and compute time in cache hits- Specified by:
registerHitsin interfaceJCacheStatistics- Parameters:
count- number of cache entry lookup hitslStartMillis- 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:JCacheStatisticsadd Cache Misses of count and compute time in cache misses- Specified by:
registerMissesin interfaceJCacheStatistics- Parameters:
count- number of cache entry lookup misseslStartMillis- start time of cache entry lookup that resulted in misses
-
registerPuts
public void registerPuts(long count, long lStartMillis) Description copied from interface:JCacheStatisticsadd Cache Puts of count and compute time in cache puts- Specified by:
registerPutsin interfaceJCacheStatistics- Parameters:
count- number of cache entry putslStartMillis- start time in milliseconds of put(s) operation
-
registerPutsCompleted
public void registerPutsCompleted(long lStartMillis) Description copied from interface:JCacheStatisticsRecord elapsed time performing puts- Specified by:
registerPutsCompletedin interfaceJCacheStatistics- Parameters:
lStartMillis- start time in milliseconds of put(s) operation
-
registerRemoves
public void registerRemoves(long count, long lStartMillis) Description copied from interface:JCacheStatisticsadd Cache Removals of count and compute time in cache removals- Specified by:
registerRemovesin interfaceJCacheStatistics- Parameters:
count- number of cache entry removalslStartMillis- start time in milliseconds of removal(s) operation
-
registerRemove
public void registerRemove()Description copied from interface:JCacheStatisticsregister a Cache Remove- Specified by:
registerRemovein interfaceJCacheStatistics
-
registerHitsCompleted
public void registerHitsCompleted(long lStartMillis) Description copied from interface:JCacheStatisticsRecord elapsed time in milliseconds performing hit(s)- Specified by:
registerHitsCompletedin interfaceJCacheStatistics- Parameters:
lStartMillis- start time in milliseconds of operation that resulted in a hit(s)
-
registerMissesCompleted
public void registerMissesCompleted(long lStartMillis) Description copied from interface:JCacheStatisticsRecord elapsed time in milliseconds performing miss(es)- Specified by:
registerMissesCompletedin interfaceJCacheStatistics- Parameters:
lStartMillis- start time in milliseconds of operation that resulted in miss(es)
-
registerRemoveCompleted
public void registerRemoveCompleted(long lStartMillis) Description copied from interface:JCacheStatisticsRecord elapsed time in milliseconds performing removal(s)- Specified by:
registerRemoveCompletedin interfaceJCacheStatistics- Parameters:
lStartMillis- start time in milliseconds of operation that resulted in removal(s)
-
getIdentifier
Description copied from interface:JCacheStatisticsGet unique JCacheIdentifier for cache that these statistics are for.- Specified by:
getIdentifierin interfaceJCacheStatistics- Returns:
- unique JCacheIdentifier
-
add
Description copied from interface:JCacheStatisticsaddJCacheStatisticsstats to this instance.- Specified by:
addin interfaceJCacheStatistics- Parameters:
stats-JCacheStatisticsfrom another data-enabled server- Returns:
- the addition of stats to this instance
-
getCacheHitsMillis
public long getCacheHitsMillis()Description copied from interface:JCacheStatisticsget time elapsed in milliseconds performing operations resulting in a hit- Specified by:
getCacheHitsMillisin interfaceJCacheStatistics- Returns:
- duration of operations that resulted in cache entry hit
-
getCacheMissesMillis
public long getCacheMissesMillis()Description copied from interface:JCacheStatisticsget time elapsed in milliseconds performing operations resulting in a miss- Specified by:
getCacheMissesMillisin interfaceJCacheStatistics- Returns:
- duration of operations that resulted in cache entry miss
-
getCachePutsMillis
public long getCachePutsMillis()Description copied from interface:JCacheStatisticsget time elapsed in milliseconds performing operations resulting in a put- Specified by:
getCachePutsMillisin interfaceJCacheStatistics- Returns:
- duration of operations that resulted in cache entry put
-
getCacheRemoveMillis
public long getCacheRemoveMillis()Description copied from interface:JCacheStatisticsget time elapsed in milliseconds performing operations resulting in a remove- Specified by:
getCacheRemoveMillisin interfaceJCacheStatistics- Returns:
- duration of operations that resulted in cache entry remove
-
clear
public void clear()- Specified by:
clearin interfacejavax.cache.management.CacheStatisticsMXBean- Specified by:
clearin interfaceJCacheStatistics
-
getCacheHits
public long getCacheHits()- Specified by:
getCacheHitsin interfacejavax.cache.management.CacheStatisticsMXBean- Specified by:
getCacheHitsin interfaceJCacheStatistics
-
getCacheHitPercentage
public float getCacheHitPercentage()- Specified by:
getCacheHitPercentagein interfacejavax.cache.management.CacheStatisticsMXBean- Specified by:
getCacheHitPercentagein interfaceJCacheStatistics
-
getCacheMisses
public long getCacheMisses()- Specified by:
getCacheMissesin interfacejavax.cache.management.CacheStatisticsMXBean- Specified by:
getCacheMissesin interfaceJCacheStatistics
-
getCacheMissPercentage
public float getCacheMissPercentage()- Specified by:
getCacheMissPercentagein interfacejavax.cache.management.CacheStatisticsMXBean- Specified by:
getCacheMissPercentagein interfaceJCacheStatistics
-
getCacheGets
public long getCacheGets()- Specified by:
getCacheGetsin interfacejavax.cache.management.CacheStatisticsMXBean- Specified by:
getCacheGetsin interfaceJCacheStatistics
-
getCachePuts
public long getCachePuts()- Specified by:
getCachePutsin interfacejavax.cache.management.CacheStatisticsMXBean- Specified by:
getCachePutsin interfaceJCacheStatistics
-
getCacheRemovals
public long getCacheRemovals()- Specified by:
getCacheRemovalsin interfacejavax.cache.management.CacheStatisticsMXBean- Specified by:
getCacheRemovalsin interfaceJCacheStatistics
-
getCacheEvictions
public long getCacheEvictions()- Specified by:
getCacheEvictionsin interfacejavax.cache.management.CacheStatisticsMXBean- Specified by:
getCacheEvictionsin interfaceJCacheStatistics
-
getAverageGetTime
public float getAverageGetTime()- Specified by:
getAverageGetTimein interfacejavax.cache.management.CacheStatisticsMXBean- Specified by:
getAverageGetTimein interfaceJCacheStatistics
-
getAveragePutTime
public float getAveragePutTime()- Specified by:
getAveragePutTimein interfacejavax.cache.management.CacheStatisticsMXBean- Specified by:
getAveragePutTimein interfaceJCacheStatistics
-
getAverageRemoveTime
public float getAverageRemoveTime()- Specified by:
getAverageRemoveTimein interfacejavax.cache.management.CacheStatisticsMXBean- Specified by:
getAverageRemoveTimein interfaceJCacheStatistics
-
readExternal
Description copied from interface:PortableObjectRestore the contents of a user type instance by reading its state using the specified PofReader object.- Specified by:
readExternalin interfacePortableObject- Parameters:
in- the PofReader from which to read the object's state- Throws:
IOException- if an I/O error occurs
-
writeExternal
Description copied from interface:PortableObjectSave the contents of a POF user type instance by writing its state using the specified PofWriter object.- Specified by:
writeExternalin interfacePortableObject- Parameters:
out- the PofWriter to which to write the object's state- Throws:
IOException- if an I/O error occurs
-
readExternal
Description copied from interface:ExternalizableLiteRestore the contents of this object by loading the object's state from the passed DataInput object.- Specified by:
readExternalin interfaceExternalizableLite- 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
Description copied from interface:ExternalizableLiteSave the contents of this object by storing the object's state into the passed DataOutput object.- Specified by:
writeExternalin interfaceExternalizableLite- Parameters:
out- the DataOutput stream to write the state of this object to- Throws:
IOException- if an I/O exception occurs
-