Package org.apache.openjpa.datacache
Class CacheStatisticsImpl
- java.lang.Object
-
- org.apache.openjpa.datacache.CacheStatisticsImpl
-
- All Implemented Interfaces:
java.io.Serializable
,CacheStatistics
,CacheStatisticsSPI
public class CacheStatisticsImpl extends java.lang.Object implements CacheStatisticsSPI
The default CacheStatistics(SPI) implementation.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CacheStatisticsImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<java.lang.String>
classNames()
Returns the types that are known to this cache being tracked.void
disable()
Disable statistics collection.void
enable()
SPI implementationlong
getHitCount()
Gets number of total read requests that has been found in cache since last reset.long
getHitCount(java.lang.Class<?> c)
Gets number of total read requests that has been found in cache for the given class since last reset.long
getHitCount(java.lang.String str)
Gets number of total read requests that has been found in cache for the given class since last reset.long
getReadCount()
Gets number of total read requests since last reset.long
getReadCount(java.lang.Class<?> c)
Gets number of total read requests for the given class since last reset.long
getReadCount(java.lang.String str)
Gets number of total read requests for the given class since last reset.long
getTotalHitCount()
Gets number of total read requests that has been found in cache since start.long
getTotalHitCount(java.lang.Class<?> c)
Gets number of total read requests that has been found in cache for the given class since start.long
getTotalHitCount(java.lang.String str)
Gets number of total read requests that has been found in cache for the given class since start.long
getTotalReadCount()
Gets number of total read requests since start.long
getTotalReadCount(java.lang.Class<?> c)
Gets number of total read requests for the given class since start.long
getTotalReadCount(java.lang.String str)
Gets number of total read requests for the given class since start.long
getTotalWriteCount()
Gets number of total write requests since start.long
getTotalWriteCount(java.lang.Class<?> c)
Gets number of total write requests for the given class since start.long
getTotalWriteCount(java.lang.String str)
Gets number of total write requests for the given class since start.long
getWriteCount()
Gets number of total write requests since last reset.long
getWriteCount(java.lang.Class<?> c)
Gets number of total write requests for the given class since last reset.long
getWriteCount(java.lang.String str)
Gets number of total write requests for the given class since last reset.boolean
isEnabled()
Returns whether or not statistics will be collected.void
newGet(java.lang.Class<?> cls, boolean hit)
Record a new cache get.void
newGet(java.lang.Object oid, boolean hit)
void
newPut(java.lang.Class<?> cls)
Record a new cache put.void
newPut(java.lang.Object oid)
void
reset()
Clears all accumulated statistics.java.util.Date
since()
Gets the time of last reset.java.util.Date
start()
Gets the time of start.java.util.Map<java.lang.String,long[]>
toMap()
-
-
-
Method Detail
-
getReadCount
public long getReadCount()
Description copied from interface:CacheStatistics
Gets number of total read requests since last reset.- Specified by:
getReadCount
in interfaceCacheStatistics
-
getHitCount
public long getHitCount()
Description copied from interface:CacheStatistics
Gets number of total read requests that has been found in cache since last reset.- Specified by:
getHitCount
in interfaceCacheStatistics
-
getWriteCount
public long getWriteCount()
Description copied from interface:CacheStatistics
Gets number of total write requests since last reset.- Specified by:
getWriteCount
in interfaceCacheStatistics
-
getTotalReadCount
public long getTotalReadCount()
Description copied from interface:CacheStatistics
Gets number of total read requests since start.- Specified by:
getTotalReadCount
in interfaceCacheStatistics
-
getTotalHitCount
public long getTotalHitCount()
Description copied from interface:CacheStatistics
Gets number of total read requests that has been found in cache since start.- Specified by:
getTotalHitCount
in interfaceCacheStatistics
-
getTotalWriteCount
public long getTotalWriteCount()
Description copied from interface:CacheStatistics
Gets number of total write requests since start.- Specified by:
getTotalWriteCount
in interfaceCacheStatistics
-
getReadCount
public long getReadCount(java.lang.Class<?> c)
Description copied from interface:CacheStatistics
Gets number of total read requests for the given class since last reset.- Specified by:
getReadCount
in interfaceCacheStatistics
-
getReadCount
public long getReadCount(java.lang.String str)
Description copied from interface:CacheStatistics
Gets number of total read requests for the given class since last reset.- Specified by:
getReadCount
in interfaceCacheStatistics
-
getHitCount
public long getHitCount(java.lang.Class<?> c)
Description copied from interface:CacheStatistics
Gets number of total read requests that has been found in cache for the given class since last reset.- Specified by:
getHitCount
in interfaceCacheStatistics
-
getHitCount
public long getHitCount(java.lang.String str)
Description copied from interface:CacheStatistics
Gets number of total read requests that has been found in cache for the given class since last reset.- Specified by:
getHitCount
in interfaceCacheStatistics
-
getWriteCount
public long getWriteCount(java.lang.Class<?> c)
Description copied from interface:CacheStatistics
Gets number of total write requests for the given class since last reset.- Specified by:
getWriteCount
in interfaceCacheStatistics
-
getWriteCount
public long getWriteCount(java.lang.String str)
Description copied from interface:CacheStatistics
Gets number of total write requests for the given class since last reset.- Specified by:
getWriteCount
in interfaceCacheStatistics
-
getTotalReadCount
public long getTotalReadCount(java.lang.Class<?> c)
Description copied from interface:CacheStatistics
Gets number of total read requests for the given class since start.- Specified by:
getTotalReadCount
in interfaceCacheStatistics
-
getTotalReadCount
public long getTotalReadCount(java.lang.String str)
Description copied from interface:CacheStatistics
Gets number of total read requests for the given class since start.- Specified by:
getTotalReadCount
in interfaceCacheStatistics
-
getTotalHitCount
public long getTotalHitCount(java.lang.Class<?> c)
Description copied from interface:CacheStatistics
Gets number of total read requests that has been found in cache for the given class since start.- Specified by:
getTotalHitCount
in interfaceCacheStatistics
-
getTotalHitCount
public long getTotalHitCount(java.lang.String str)
Description copied from interface:CacheStatistics
Gets number of total read requests that has been found in cache for the given class since start.- Specified by:
getTotalHitCount
in interfaceCacheStatistics
-
getTotalWriteCount
public long getTotalWriteCount(java.lang.Class<?> c)
Description copied from interface:CacheStatistics
Gets number of total write requests for the given class since start.- Specified by:
getTotalWriteCount
in interfaceCacheStatistics
-
getTotalWriteCount
public long getTotalWriteCount(java.lang.String str)
Description copied from interface:CacheStatistics
Gets number of total write requests for the given class since start.- Specified by:
getTotalWriteCount
in interfaceCacheStatistics
-
since
public java.util.Date since()
Description copied from interface:CacheStatistics
Gets the time of last reset.- Specified by:
since
in interfaceCacheStatistics
-
start
public java.util.Date start()
Description copied from interface:CacheStatistics
Gets the time of start.- Specified by:
start
in interfaceCacheStatistics
-
reset
public void reset()
Description copied from interface:CacheStatistics
Clears all accumulated statistics.- Specified by:
reset
in interfaceCacheStatistics
-
isEnabled
public boolean isEnabled()
Description copied from interface:CacheStatistics
Returns whether or not statistics will be collected.- Specified by:
isEnabled
in interfaceCacheStatistics
-
classNames
public java.util.Set<java.lang.String> classNames()
Description copied from interface:CacheStatistics
Returns the types that are known to this cache being tracked.- Specified by:
classNames
in interfaceCacheStatistics
-
toMap
public java.util.Map<java.lang.String,long[]> toMap()
- Specified by:
toMap
in interfaceCacheStatistics
-
enable
public void enable()
SPI implementation- Specified by:
enable
in interfaceCacheStatisticsSPI
-
disable
public void disable()
Description copied from interface:CacheStatisticsSPI
Disable statistics collection.- Specified by:
disable
in interfaceCacheStatisticsSPI
-
newGet
public void newGet(java.lang.Class<?> cls, boolean hit)
Description copied from interface:CacheStatisticsSPI
Record a new cache get.- Specified by:
newGet
in interfaceCacheStatisticsSPI
- Parameters:
cls
- - The class describing the type that is contained in the cache.hit
- - true for a cache hit, false otherwise
-
newGet
public void newGet(java.lang.Object oid, boolean hit)
-
newPut
public void newPut(java.lang.Class<?> cls)
Description copied from interface:CacheStatisticsSPI
Record a new cache put.- Specified by:
newPut
in interfaceCacheStatisticsSPI
- Parameters:
cls
- - The class describing the type that is contained in the cache.
-
newPut
public void newPut(java.lang.Object oid)
-
-