Class AbstractPreparedQueryCacheInstrument
- java.lang.Object
-
- org.apache.openjpa.lib.instrumentation.AbstractInstrument
-
- org.apache.openjpa.instrumentation.AbstractPreparedQueryCacheInstrument
-
- All Implemented Interfaces:
PreparedQueryCacheInstrument
,Instrument
- Direct Known Subclasses:
PreparedQueryCacheJMXInstrument
public abstract class AbstractPreparedQueryCacheInstrument extends AbstractInstrument implements PreparedQueryCacheInstrument
Provides a basic instrument implementation wrapper for the prepared query cache. This class can be extended to create a provider specific instrument for the prepared query cache.
-
-
Field Summary
Fields Modifier and Type Field Description static long
NO_STATS
-
Constructor Summary
Constructors Constructor Description AbstractPreparedQueryCacheInstrument()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getConfigId()
java.lang.String
getContextRef()
long
getExecutionCount()
Returns number of total execution requests since last resetlong
getExecutionCount(java.lang.String query)
Returns number of total execution requests since last resetlong
getHitCount()
Returns number of total read requests that have been found in cache since last reset.long
getHitCount(java.lang.String query)
Returns number of total read requests that have been found in cache since last reset.InstrumentationLevel
getLevel()
Gets the instrumentation level of this instrument.long
getTotalExecutionCount()
Returns number of total exec requests since start.long
getTotalExecutionCount(java.lang.String query)
Returns number of total exec requests since start.long
getTotalHitCount()
Returns number of total read requests that has been found since start.long
getTotalHitCount(java.lang.String query)
Returns number of total read requests that has been found since start.java.util.Set<java.lang.String>
queries()
Returns all queries currently tracked in the cache.void
reset()
Resets cache statisticsvoid
setConfigId(java.lang.String cid)
void
setContextRef(java.lang.String cref)
void
setPreparedQueryCache(PreparedQueryCache qc)
java.util.Date
sinceDate()
Returns date since cache statistics collection were last reset.java.util.Date
startDate()
Returns date cache statistics collection started.-
Methods inherited from class org.apache.openjpa.lib.instrumentation.AbstractInstrument
getContext, getName, getOptions, getProvider, initialize, isStarted, restart, setContext, setOptions, setProvider, setStarted
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.openjpa.lib.instrumentation.Instrument
start, stop
-
-
-
-
Field Detail
-
NO_STATS
public static final long NO_STATS
- See Also:
- Constant Field Values
-
-
Method Detail
-
setConfigId
public void setConfigId(java.lang.String cid)
-
setContextRef
public void setContextRef(java.lang.String cref)
-
getConfigId
public java.lang.String getConfigId()
-
getContextRef
public java.lang.String getContextRef()
-
setPreparedQueryCache
public void setPreparedQueryCache(PreparedQueryCache qc)
-
getExecutionCount
public long getExecutionCount()
Description copied from interface:PreparedQueryCacheInstrument
Returns number of total execution requests since last reset- Specified by:
getExecutionCount
in interfacePreparedQueryCacheInstrument
-
getExecutionCount
public long getExecutionCount(java.lang.String query)
Description copied from interface:PreparedQueryCacheInstrument
Returns number of total execution requests since last reset- Specified by:
getExecutionCount
in interfacePreparedQueryCacheInstrument
-
getTotalExecutionCount
public long getTotalExecutionCount()
Description copied from interface:PreparedQueryCacheInstrument
Returns number of total exec requests since start.- Specified by:
getTotalExecutionCount
in interfacePreparedQueryCacheInstrument
-
getTotalExecutionCount
public long getTotalExecutionCount(java.lang.String query)
Description copied from interface:PreparedQueryCacheInstrument
Returns number of total exec requests since start.- Specified by:
getTotalExecutionCount
in interfacePreparedQueryCacheInstrument
-
getHitCount
public long getHitCount()
Description copied from interface:PreparedQueryCacheInstrument
Returns number of total read requests that have been found in cache since last reset.- Specified by:
getHitCount
in interfacePreparedQueryCacheInstrument
-
getHitCount
public long getHitCount(java.lang.String query)
Description copied from interface:PreparedQueryCacheInstrument
Returns number of total read requests that have been found in cache since last reset.- Specified by:
getHitCount
in interfacePreparedQueryCacheInstrument
-
getTotalHitCount
public long getTotalHitCount()
Description copied from interface:PreparedQueryCacheInstrument
Returns number of total read requests that has been found since start.- Specified by:
getTotalHitCount
in interfacePreparedQueryCacheInstrument
-
getTotalHitCount
public long getTotalHitCount(java.lang.String query)
Description copied from interface:PreparedQueryCacheInstrument
Returns number of total read requests that has been found since start.- Specified by:
getTotalHitCount
in interfacePreparedQueryCacheInstrument
-
reset
public void reset()
Description copied from interface:PreparedQueryCacheInstrument
Resets cache statistics- Specified by:
reset
in interfacePreparedQueryCacheInstrument
-
sinceDate
public java.util.Date sinceDate()
Description copied from interface:PreparedQueryCacheInstrument
Returns date since cache statistics collection were last reset.- Specified by:
sinceDate
in interfacePreparedQueryCacheInstrument
-
startDate
public java.util.Date startDate()
Description copied from interface:PreparedQueryCacheInstrument
Returns date cache statistics collection started.- Specified by:
startDate
in interfacePreparedQueryCacheInstrument
-
queries
public java.util.Set<java.lang.String> queries()
Description copied from interface:PreparedQueryCacheInstrument
Returns all queries currently tracked in the cache.- Specified by:
queries
in interfacePreparedQueryCacheInstrument
-
getLevel
public InstrumentationLevel getLevel()
Description copied from interface:Instrument
Gets the instrumentation level of this instrument. The instrumentation level determines if and when the instrument will automatically start and stop.- Specified by:
getLevel
in interfaceInstrument
- Overrides:
getLevel
in classAbstractInstrument
- Returns:
- the instrumentation level of the instrument
-
-