Package org.apache.openjpa.datacache
Class CacheStatisticsImpl
- java.lang.Object
 - 
- org.apache.openjpa.datacache.CacheStatisticsImpl
 
 
- 
- All Implemented Interfaces:
 Serializable,CacheStatistics,CacheStatisticsSPI
public class CacheStatisticsImpl extends 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 Set<String>classNames()Returns the types that are known to this cache being tracked.voiddisable()Disable statistics collection.voidenable()SPI implementationlonggetHitCount()Gets number of total read requests that has been found in cache since last reset.longgetHitCount(Class<?> c)Gets number of total read requests that has been found in cache for the given class since last reset.longgetHitCount(String str)Gets number of total read requests that has been found in cache for the given class since last reset.longgetReadCount()Gets number of total read requests since last reset.longgetReadCount(Class<?> c)Gets number of total read requests for the given class since last reset.longgetReadCount(String str)Gets number of total read requests for the given class since last reset.longgetTotalHitCount()Gets number of total read requests that has been found in cache since start.longgetTotalHitCount(Class<?> c)Gets number of total read requests that has been found in cache for the given class since start.longgetTotalHitCount(String str)Gets number of total read requests that has been found in cache for the given class since start.longgetTotalReadCount()Gets number of total read requests since start.longgetTotalReadCount(Class<?> c)Gets number of total read requests for the given class since start.longgetTotalReadCount(String str)Gets number of total read requests for the given class since start.longgetTotalWriteCount()Gets number of total write requests since start.longgetTotalWriteCount(Class<?> c)Gets number of total write requests for the given class since start.longgetTotalWriteCount(String str)Gets number of total write requests for the given class since start.longgetWriteCount()Gets number of total write requests since last reset.longgetWriteCount(Class<?> c)Gets number of total write requests for the given class since last reset.longgetWriteCount(String str)Gets number of total write requests for the given class since last reset.booleanisEnabled()Returns whether or not statistics will be collected.voidnewGet(Class<?> cls, boolean hit)Record a new cache get.voidnewGet(Object oid, boolean hit)voidnewPut(Class<?> cls)Record a new cache put.voidnewPut(Object oid)voidreset()Clears all accumulated statistics.Datesince()Gets the time of last reset.Datestart()Gets the time of start.Map<String,long[]>toMap() 
 - 
 
- 
- 
Method Detail
- 
getReadCount
public long getReadCount()
Description copied from interface:CacheStatisticsGets number of total read requests since last reset.- Specified by:
 getReadCountin interfaceCacheStatistics
 
- 
getHitCount
public long getHitCount()
Description copied from interface:CacheStatisticsGets number of total read requests that has been found in cache since last reset.- Specified by:
 getHitCountin interfaceCacheStatistics
 
- 
getWriteCount
public long getWriteCount()
Description copied from interface:CacheStatisticsGets number of total write requests since last reset.- Specified by:
 getWriteCountin interfaceCacheStatistics
 
- 
getTotalReadCount
public long getTotalReadCount()
Description copied from interface:CacheStatisticsGets number of total read requests since start.- Specified by:
 getTotalReadCountin interfaceCacheStatistics
 
- 
getTotalHitCount
public long getTotalHitCount()
Description copied from interface:CacheStatisticsGets number of total read requests that has been found in cache since start.- Specified by:
 getTotalHitCountin interfaceCacheStatistics
 
- 
getTotalWriteCount
public long getTotalWriteCount()
Description copied from interface:CacheStatisticsGets number of total write requests since start.- Specified by:
 getTotalWriteCountin interfaceCacheStatistics
 
- 
getReadCount
public long getReadCount(Class<?> c)
Description copied from interface:CacheStatisticsGets number of total read requests for the given class since last reset.- Specified by:
 getReadCountin interfaceCacheStatistics
 
- 
getReadCount
public long getReadCount(String str)
Description copied from interface:CacheStatisticsGets number of total read requests for the given class since last reset.- Specified by:
 getReadCountin interfaceCacheStatistics
 
- 
getHitCount
public long getHitCount(Class<?> c)
Description copied from interface:CacheStatisticsGets number of total read requests that has been found in cache for the given class since last reset.- Specified by:
 getHitCountin interfaceCacheStatistics
 
- 
getHitCount
public long getHitCount(String str)
Description copied from interface:CacheStatisticsGets number of total read requests that has been found in cache for the given class since last reset.- Specified by:
 getHitCountin interfaceCacheStatistics
 
- 
getWriteCount
public long getWriteCount(Class<?> c)
Description copied from interface:CacheStatisticsGets number of total write requests for the given class since last reset.- Specified by:
 getWriteCountin interfaceCacheStatistics
 
- 
getWriteCount
public long getWriteCount(String str)
Description copied from interface:CacheStatisticsGets number of total write requests for the given class since last reset.- Specified by:
 getWriteCountin interfaceCacheStatistics
 
- 
getTotalReadCount
public long getTotalReadCount(Class<?> c)
Description copied from interface:CacheStatisticsGets number of total read requests for the given class since start.- Specified by:
 getTotalReadCountin interfaceCacheStatistics
 
- 
getTotalReadCount
public long getTotalReadCount(String str)
Description copied from interface:CacheStatisticsGets number of total read requests for the given class since start.- Specified by:
 getTotalReadCountin interfaceCacheStatistics
 
- 
getTotalHitCount
public long getTotalHitCount(Class<?> c)
Description copied from interface:CacheStatisticsGets number of total read requests that has been found in cache for the given class since start.- Specified by:
 getTotalHitCountin interfaceCacheStatistics
 
- 
getTotalHitCount
public long getTotalHitCount(String str)
Description copied from interface:CacheStatisticsGets number of total read requests that has been found in cache for the given class since start.- Specified by:
 getTotalHitCountin interfaceCacheStatistics
 
- 
getTotalWriteCount
public long getTotalWriteCount(Class<?> c)
Description copied from interface:CacheStatisticsGets number of total write requests for the given class since start.- Specified by:
 getTotalWriteCountin interfaceCacheStatistics
 
- 
getTotalWriteCount
public long getTotalWriteCount(String str)
Description copied from interface:CacheStatisticsGets number of total write requests for the given class since start.- Specified by:
 getTotalWriteCountin interfaceCacheStatistics
 
- 
since
public Date since()
Description copied from interface:CacheStatisticsGets the time of last reset.- Specified by:
 sincein interfaceCacheStatistics
 
- 
start
public Date start()
Description copied from interface:CacheStatisticsGets the time of start.- Specified by:
 startin interfaceCacheStatistics
 
- 
reset
public void reset()
Description copied from interface:CacheStatisticsClears all accumulated statistics.- Specified by:
 resetin interfaceCacheStatistics
 
- 
isEnabled
public boolean isEnabled()
Description copied from interface:CacheStatisticsReturns whether or not statistics will be collected.- Specified by:
 isEnabledin interfaceCacheStatistics
 
- 
classNames
public Set<String> classNames()
Description copied from interface:CacheStatisticsReturns the types that are known to this cache being tracked.- Specified by:
 classNamesin interfaceCacheStatistics
 
- 
toMap
public Map<String,long[]> toMap()
- Specified by:
 toMapin interfaceCacheStatistics
 
- 
enable
public void enable()
SPI implementation- Specified by:
 enablein interfaceCacheStatisticsSPI
 
- 
disable
public void disable()
Description copied from interface:CacheStatisticsSPIDisable statistics collection.- Specified by:
 disablein interfaceCacheStatisticsSPI
 
- 
newGet
public void newGet(Class<?> cls, boolean hit)
Description copied from interface:CacheStatisticsSPIRecord a new cache get.- Specified by:
 newGetin 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(Object oid, boolean hit)
 
- 
newPut
public void newPut(Class<?> cls)
Description copied from interface:CacheStatisticsSPIRecord a new cache put.- Specified by:
 newPutin interfaceCacheStatisticsSPI- Parameters:
 cls- - The class describing the type that is contained in the cache.
 
- 
newPut
public void newPut(Object oid)
 
 - 
 
 -