org.apache.openjpa.datacache
Class CacheStatisticsImpl

java.lang.Object
  extended by 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
CacheStatisticsImpl()
           
 
Method Summary
 Set<String> classNames()
          Returns the types that are known to this cache being tracked.
 void disable()
          Disable statistics collection.
 void enable()
          SPI implementation
 long getHitCount()
          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 getReadCount()
          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 getTotalHitCount()
          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 getTotalReadCount()
          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 getTotalWriteCount()
          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 getWriteCount()
          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 isEnabled()
          Returns whether or not statistics will be collected.
 void newGet(Class<?> cls, boolean hit)
          Record a new cache get.
 void newGet(Object oid, boolean hit)
           
 void newPut(Class<?> cls)
          Record a new cache put.
 void newPut(Object oid)
           
 void reset()
          Clears all accumulated statistics.
 Date since()
          Gets the time of last reset.
 Date start()
          Gets the time of start.
 Map<String,long[]> toMap()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheStatisticsImpl

public CacheStatisticsImpl()
Method Detail

getReadCount

public long getReadCount()
Description copied from interface: CacheStatistics
Gets number of total read requests since last reset.

Specified by:
getReadCount in interface CacheStatistics

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 interface CacheStatistics

getWriteCount

public long getWriteCount()
Description copied from interface: CacheStatistics
Gets number of total write requests since last reset.

Specified by:
getWriteCount in interface CacheStatistics

getTotalReadCount

public long getTotalReadCount()
Description copied from interface: CacheStatistics
Gets number of total read requests since start.

Specified by:
getTotalReadCount in interface CacheStatistics

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 interface CacheStatistics

getTotalWriteCount

public long getTotalWriteCount()
Description copied from interface: CacheStatistics
Gets number of total write requests since start.

Specified by:
getTotalWriteCount in interface CacheStatistics

getReadCount

public long getReadCount(Class<?> c)
Description copied from interface: CacheStatistics
Gets number of total read requests for the given class since last reset.

Specified by:
getReadCount in interface CacheStatistics

getReadCount

public long getReadCount(String str)
Description copied from interface: CacheStatistics
Gets number of total read requests for the given class since last reset.

Specified by:
getReadCount in interface CacheStatistics

getHitCount

public long getHitCount(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 interface CacheStatistics

getHitCount

public long getHitCount(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 interface CacheStatistics

getWriteCount

public long getWriteCount(Class<?> c)
Description copied from interface: CacheStatistics
Gets number of total write requests for the given class since last reset.

Specified by:
getWriteCount in interface CacheStatistics

getWriteCount

public long getWriteCount(String str)
Description copied from interface: CacheStatistics
Gets number of total write requests for the given class since last reset.

Specified by:
getWriteCount in interface CacheStatistics

getTotalReadCount

public long getTotalReadCount(Class<?> c)
Description copied from interface: CacheStatistics
Gets number of total read requests for the given class since start.

Specified by:
getTotalReadCount in interface CacheStatistics

getTotalReadCount

public long getTotalReadCount(String str)
Description copied from interface: CacheStatistics
Gets number of total read requests for the given class since start.

Specified by:
getTotalReadCount in interface CacheStatistics

getTotalHitCount

public long getTotalHitCount(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 interface CacheStatistics

getTotalHitCount

public long getTotalHitCount(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 interface CacheStatistics

getTotalWriteCount

public long getTotalWriteCount(Class<?> c)
Description copied from interface: CacheStatistics
Gets number of total write requests for the given class since start.

Specified by:
getTotalWriteCount in interface CacheStatistics

getTotalWriteCount

public long getTotalWriteCount(String str)
Description copied from interface: CacheStatistics
Gets number of total write requests for the given class since start.

Specified by:
getTotalWriteCount in interface CacheStatistics

since

public Date since()
Description copied from interface: CacheStatistics
Gets the time of last reset.

Specified by:
since in interface CacheStatistics

start

public Date start()
Description copied from interface: CacheStatistics
Gets the time of start.

Specified by:
start in interface CacheStatistics

reset

public void reset()
Description copied from interface: CacheStatistics
Clears all accumulated statistics.

Specified by:
reset in interface CacheStatistics

isEnabled

public boolean isEnabled()
Description copied from interface: CacheStatistics
Returns whether or not statistics will be collected.

Specified by:
isEnabled in interface CacheStatistics

classNames

public Set<String> classNames()
Description copied from interface: CacheStatistics
Returns the types that are known to this cache being tracked.

Specified by:
classNames in interface CacheStatistics

toMap

public Map<String,long[]> toMap()
Specified by:
toMap in interface CacheStatistics

enable

public void enable()
SPI implementation

Specified by:
enable in interface CacheStatisticsSPI

disable

public void disable()
Description copied from interface: CacheStatisticsSPI
Disable statistics collection.

Specified by:
disable in interface CacheStatisticsSPI

newGet

public void newGet(Class<?> cls,
                   boolean hit)
Description copied from interface: CacheStatisticsSPI
Record a new cache get.

Specified by:
newGet in interface CacheStatisticsSPI
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: CacheStatisticsSPI
Record a new cache put.

Specified by:
newPut in interface CacheStatisticsSPI
Parameters:
cls - - The class describing the type that is contained in the cache.

newPut

public void newPut(Object oid)


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.