org.apache.openjpa.datacache
Interface CacheStatistics

All Superinterfaces:
Serializable
All Known Implementing Classes:
CacheStatistics.Default

public interface CacheStatistics
extends Serializable

Counts number of read/write requests and hit ratio for a cache in total and per-class basis. All methods with Class as input argument treats null as java.lang.Object. All per-class statistics depends on determining the runtime type of the instance being cached. If it is not possible to determine the runtime type from the given context, the statistics is registered under generic java.lang.Object.

Since:
1.3.0
Author:
Pinaki Poddar

Nested Class Summary
static class CacheStatistics.Default
          A default implementation.
 
Method Summary
 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 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 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 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 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 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.
 boolean isEnabled()
          Returns whether or not statistics will be collected.
 void reset()
          Clears all accumulated statistics.
 Date since()
          Gets the time of last reset.
 Date start()
          Gets the time of start.
 

Method Detail

getReadCount

long getReadCount()
Gets number of total read requests since last reset.


getHitCount

long getHitCount()
Gets number of total read requests that has been found in cache since last reset.


getWriteCount

long getWriteCount()
Gets number of total write requests since last reset.


getTotalReadCount

long getTotalReadCount()
Gets number of total read requests since start.


getTotalHitCount

long getTotalHitCount()
Gets number of total read requests that has been found in cache since start.


getTotalWriteCount

long getTotalWriteCount()
Gets number of total write requests since start.


getReadCount

long getReadCount(Class c)
Gets number of total read requests for the given class since last reset.


getHitCount

long getHitCount(Class c)
Gets number of total read requests that has been found in cache for the given class since last reset.


getWriteCount

long getWriteCount(Class c)
Gets number of total write requests for the given class since last reset.


getTotalReadCount

long getTotalReadCount(Class c)
Gets number of total read requests for the given class since start.


getTotalHitCount

long getTotalHitCount(Class c)
Gets number of total read requests that has been found in cache for the given class since start.


getTotalWriteCount

long getTotalWriteCount(Class c)
Gets number of total write requests for the given class since start.


since

Date since()
Gets the time of last reset.


start

Date start()
Gets the time of start.


reset

void reset()
Clears all accumulated statistics.


isEnabled

boolean isEnabled()
Returns whether or not statistics will be collected.



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