Package org.apache.openjpa.datacache
Class CacheStatisticsImpl
java.lang.Object
org.apache.openjpa.datacache.CacheStatisticsImpl
- All Implemented Interfaces:
Serializable
,CacheStatistics
,CacheStatisticsSPI
The default CacheStatistics(SPI) implementation.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the types that are known to this cache being tracked.void
disable()
Disable statistics collection.void
enable()
SPI implementationlong
Gets number of total read requests that has been found in cache since last reset.long
getHitCount
(Class<?> c) Gets number of total read requests that has been found in cache for the given class since last reset.long
getHitCount
(String str) Gets number of total read requests that has been found in cache for the given class since last reset.long
Gets number of total read requests since last reset.long
getReadCount
(Class<?> c) Gets number of total read requests for the given class since last reset.long
getReadCount
(String str) Gets number of total read requests for the given class since last reset.long
Gets number of total read requests that has been found in cache since start.long
getTotalHitCount
(Class<?> c) Gets number of total read requests that has been found in cache for the given class since start.long
getTotalHitCount
(String str) Gets number of total read requests that has been found in cache for the given class since start.long
Gets number of total read requests since start.long
getTotalReadCount
(Class<?> c) Gets number of total read requests for the given class since start.long
getTotalReadCount
(String str) Gets number of total read requests for the given class since start.long
Gets number of total write requests since start.long
getTotalWriteCount
(Class<?> c) Gets number of total write requests for the given class since start.long
getTotalWriteCount
(String str) Gets number of total write requests for the given class since start.long
Gets number of total write requests since last reset.long
getWriteCount
(Class<?> c) Gets number of total write requests for the given class since last reset.long
getWriteCount
(String str) Gets number of total write requests for the given class since last reset.boolean
Returns whether or not statistics will be collected.void
Record a new cache get.void
void
Record a new cache put.void
void
reset()
Clears all accumulated statistics.since()
Gets the time of last reset.start()
Gets the time of start.toMap()
-
Constructor Details
-
CacheStatisticsImpl
public CacheStatisticsImpl()
-
-
Method Details
-
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
Description copied from interface:CacheStatistics
Gets number of total read requests for the given class since last reset.- Specified by:
getReadCount
in interfaceCacheStatistics
-
getReadCount
Description copied from interface:CacheStatistics
Gets number of total read requests for the given class since last reset.- Specified by:
getReadCount
in interfaceCacheStatistics
-
getHitCount
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
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
Description copied from interface:CacheStatistics
Gets number of total write requests for the given class since last reset.- Specified by:
getWriteCount
in interfaceCacheStatistics
-
getWriteCount
Description copied from interface:CacheStatistics
Gets number of total write requests for the given class since last reset.- Specified by:
getWriteCount
in interfaceCacheStatistics
-
getTotalReadCount
Description copied from interface:CacheStatistics
Gets number of total read requests for the given class since start.- Specified by:
getTotalReadCount
in interfaceCacheStatistics
-
getTotalReadCount
Description copied from interface:CacheStatistics
Gets number of total read requests for the given class since start.- Specified by:
getTotalReadCount
in interfaceCacheStatistics
-
getTotalHitCount
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
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
Description copied from interface:CacheStatistics
Gets number of total write requests for the given class since start.- Specified by:
getTotalWriteCount
in interfaceCacheStatistics
-
getTotalWriteCount
Description copied from interface:CacheStatistics
Gets number of total write requests for the given class since start.- Specified by:
getTotalWriteCount
in interfaceCacheStatistics
-
since
Description copied from interface:CacheStatistics
Gets the time of last reset.- Specified by:
since
in interfaceCacheStatistics
-
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
Description copied from interface:CacheStatistics
Returns the types that are known to this cache being tracked.- Specified by:
classNames
in interfaceCacheStatistics
-
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
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
-
newPut
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
-