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
ConstructorDescriptionConstructs ...Constructs JCacheStatistics for cacheid
-
Method Summary
Modifier and TypeMethodDescriptionadd
(JCacheStatistics stats) addJCacheStatistics
stats to this instance.void
clear()
float
float
float
long
long
float
long
long
get time elapsed in milliseconds performing operations resulting in a hitlong
long
get time elapsed in milliseconds performing operations resulting in a missfloat
long
long
get time elapsed in milliseconds performing operations resulting in a putlong
long
get time elapsed in milliseconds performing operations resulting in a removeGet unique JCacheIdentifier for cache that these statistics are for.void
Restore the contents of a user type instance by reading its state using the specified PofReader object.void
Restore the contents of this object by loading the object's state from the passed DataInput object.void
registerHits
(int count, long lStartMillis) add Cache Hits of count and compute time in cache hitsvoid
registerHitsCompleted
(long lStartMillis) Record elapsed time in milliseconds performing hit(s)void
registerMisses
(int count, long lStartMillis) add Cache Misses of count and compute time in cache missesvoid
registerMissesCompleted
(long lStartMillis) Record elapsed time in milliseconds performing miss(es)void
registerPuts
(long count, long lStartMillis) add Cache Puts of count and compute time in cache putsvoid
registerPutsCompleted
(long lStartMillis) Record elapsed time performing putsvoid
register a Cache Removevoid
registerRemoveCompleted
(long lStartMillis) Record elapsed time in milliseconds performing removal(s)void
registerRemoves
(long count, long lStartMillis) add Cache Removals of count and compute time in cache removalsvoid
writeExternal
(PofWriter out) Save the contents of a POF user type instance by writing its state using the specified PofWriter object.void
writeExternal
(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:JCacheStatistics
add Cache Hits of count and compute time in cache hits- Specified by:
registerHits
in 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:JCacheStatistics
add Cache Misses of count and compute time in cache misses- Specified by:
registerMisses
in 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:JCacheStatistics
add Cache Puts of count and compute time in cache puts- Specified by:
registerPuts
in 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:JCacheStatistics
Record elapsed time performing puts- Specified by:
registerPutsCompleted
in interfaceJCacheStatistics
- 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 interfaceJCacheStatistics
- Parameters:
count
- number of cache entry removalslStartMillis
- 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 interfaceJCacheStatistics
-
registerHitsCompleted
public void registerHitsCompleted(long lStartMillis) Description copied from interface:JCacheStatistics
Record elapsed time in milliseconds performing hit(s)- Specified by:
registerHitsCompleted
in 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:JCacheStatistics
Record elapsed time in milliseconds performing miss(es)- Specified by:
registerMissesCompleted
in interfaceJCacheStatistics
- 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 interfaceJCacheStatistics
- Parameters:
lStartMillis
- start time in milliseconds of operation that resulted in removal(s)
-
getIdentifier
Description copied from interface:JCacheStatistics
Get unique JCacheIdentifier for cache that these statistics are for.- Specified by:
getIdentifier
in interfaceJCacheStatistics
- Returns:
- unique JCacheIdentifier
-
add
Description copied from interface:JCacheStatistics
addJCacheStatistics
stats to this instance.- Specified by:
add
in interfaceJCacheStatistics
- 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 interfaceJCacheStatistics
- 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 interfaceJCacheStatistics
- 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 interfaceJCacheStatistics
- 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 interfaceJCacheStatistics
- Returns:
- duration of operations that resulted in cache entry remove
-
clear
public void clear()- Specified by:
clear
in interfacejavax.cache.management.CacheStatisticsMXBean
- Specified by:
clear
in interfaceJCacheStatistics
-
getCacheHits
public long getCacheHits()- Specified by:
getCacheHits
in interfacejavax.cache.management.CacheStatisticsMXBean
- Specified by:
getCacheHits
in interfaceJCacheStatistics
-
getCacheHitPercentage
public float getCacheHitPercentage()- Specified by:
getCacheHitPercentage
in interfacejavax.cache.management.CacheStatisticsMXBean
- Specified by:
getCacheHitPercentage
in interfaceJCacheStatistics
-
getCacheMisses
public long getCacheMisses()- Specified by:
getCacheMisses
in interfacejavax.cache.management.CacheStatisticsMXBean
- Specified by:
getCacheMisses
in interfaceJCacheStatistics
-
getCacheMissPercentage
public float getCacheMissPercentage()- Specified by:
getCacheMissPercentage
in interfacejavax.cache.management.CacheStatisticsMXBean
- Specified by:
getCacheMissPercentage
in interfaceJCacheStatistics
-
getCacheGets
public long getCacheGets()- Specified by:
getCacheGets
in interfacejavax.cache.management.CacheStatisticsMXBean
- Specified by:
getCacheGets
in interfaceJCacheStatistics
-
getCachePuts
public long getCachePuts()- Specified by:
getCachePuts
in interfacejavax.cache.management.CacheStatisticsMXBean
- Specified by:
getCachePuts
in interfaceJCacheStatistics
-
getCacheRemovals
public long getCacheRemovals()- Specified by:
getCacheRemovals
in interfacejavax.cache.management.CacheStatisticsMXBean
- Specified by:
getCacheRemovals
in interfaceJCacheStatistics
-
getCacheEvictions
public long getCacheEvictions()- Specified by:
getCacheEvictions
in interfacejavax.cache.management.CacheStatisticsMXBean
- Specified by:
getCacheEvictions
in interfaceJCacheStatistics
-
getAverageGetTime
public float getAverageGetTime()- Specified by:
getAverageGetTime
in interfacejavax.cache.management.CacheStatisticsMXBean
- Specified by:
getAverageGetTime
in interfaceJCacheStatistics
-
getAveragePutTime
public float getAveragePutTime()- Specified by:
getAveragePutTime
in interfacejavax.cache.management.CacheStatisticsMXBean
- Specified by:
getAveragePutTime
in interfaceJCacheStatistics
-
getAverageRemoveTime
public float getAverageRemoveTime()- Specified by:
getAverageRemoveTime
in interfacejavax.cache.management.CacheStatisticsMXBean
- Specified by:
getAverageRemoveTime
in interfaceJCacheStatistics
-
readExternal
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 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:PortableObject
Save the contents of a POF user type instance by writing its state using the specified PofWriter object.- Specified by:
writeExternal
in 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:ExternalizableLite
Restore the contents of this object by loading the object's state from the passed DataInput object.- Specified by:
readExternal
in 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:ExternalizableLite
Save the contents of this object by storing the object's state into the passed DataOutput object.- Specified by:
writeExternal
in interfaceExternalizableLite
- Parameters:
out
- the DataOutput stream to write the state of this object to- Throws:
IOException
- if an I/O exception occurs
-