| Modifier and Type | Class and Description |
|---|---|
| protected class | AbstractQueryReport.
Class to measure query execute time |
| Modifier and Type | Field and Description |
|---|---|
| private static final Log | |
| protected long | threshold
The threshold in milliseconds. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | createStatement(Object
the actual proxy object proxy, Method the method that was called. It will be one of the methods defined in method, Object[] STATEMENT_TYPESthe arguments to the method args, Object the statement that the underlying connection created statement, long Elapsed time time)Implements abstract org. Creates a statement interceptor to monitor query response times |
| public long | |
| protected abstract void | prepareCall(String
- the string used to prepare the statement with query, long - the time it took to invoke prepare time)Invoked when prepareCall has been called and completed. |
| protected abstract void | prepareStatement(String
- the string used to prepare the statement with sql, long - the time it took to invoke prepare time)Invoked when prepareStatement has been called and completed. |
| protected String | Returns: - the SQL that was executed or the string "batch" if it was a batch executionthe query that was executed and failed query, Object[] the arguments to the execution args, final String the name of the method used to execute name, long AbstractCreateStatementInterceptor#isExecute(Method, boolean)the time the query execution started start, Throwable the exception that happened t)Invoked when a query execution, a call to execute/executeQuery or executeBatch failed. |
| protected String | Returns: - the SQL that was executed or the string "batch" if it was a batch executionthe query that was executed and failed query, Object[] the arguments to the execution args, final String the name of the method used to execute name, long AbstractCreateStatementInterceptor#isExecute(Method, boolean)the time the query execution started start, long the time the execution took delta)Invoked when a query execution, a call to execute/executeQuery or executeBatch succeeded and was within the timing threshold |
| protected String | Returns: - the SQL that was executed or the string "batch" if it was a batch executionthe query that was executed and failed query, Object[] the arguments to the execution args, final String the name of the method used to execute name, long AbstractCreateStatementInterceptor#isExecute(Method, boolean)the time the query execution started start, long the time the execution took delta)Invoked when a query execution, a call to execute/executeQuery or executeBatch succeeded and was exceeded the timing threshold |
| public void | setThreshold(long
set to -1 to record every query. Value is in milliseconds. threshold)Sets the query measurement threshold. |
| log | back to summary |
|---|---|
| private static final Log log | |
| threshold | back to summary |
|---|---|
| protected long threshold The threshold in milliseconds. If the query is faster than this, we don't measure it | |
| AbstractQueryReport | back to summary |
|---|---|
| public AbstractQueryReport() | |
| getThreshold | back to summary |
|---|---|
| public long getThreshold() returns the query measure threshold. This value is in milliseconds. If the query is faster than this threshold than it won't be accounted for
| |
| prepareCall | back to summary |
|---|---|
| protected abstract void prepareCall(String query, long time) Invoked when prepareCall has been called and completed.
| |
| prepareStatement | back to summary |
|---|---|
| protected abstract void prepareStatement(String sql, long time) Invoked when prepareStatement has been called and completed.
| |
| reportFailedQuery | back to summary |
|---|---|
| protected String reportFailedQuery(String query, Object[] args, final String name, long start, Throwable t) Invoked when a query execution, a call to execute/executeQuery or executeBatch failed.
| |
| reportQuery | back to summary |
|---|---|
| protected String reportQuery(String query, Object[] args, final String name, long start, long delta) Invoked when a query execution, a call to execute/executeQuery or executeBatch succeeded and was within the timing threshold
| |
| reportSlowQuery | back to summary |
|---|---|
| protected String reportSlowQuery(String query, Object[] args, final String name, long start, long delta) Invoked when a query execution, a call to execute/executeQuery or executeBatch succeeded and was exceeded the timing threshold
| |
| setThreshold | back to summary |
|---|---|
| public void setThreshold(long threshold) Sets the query measurement threshold. The value is in milliseconds. If the query goes faster than this threshold it will not be recorded.
| |
| Modifier and Type | Field and Description |
|---|---|
| protected boolean | |
| protected Object | |
| protected final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | invoke(Object
the proxy instance that the method was invoked on proxy, Method the method, Object[] Method instance corresponding to
the interface method invoked on the proxy instance. The declaring
class of the Method object will be the interface that
the method was declared in, which may be a superinterface of the
proxy interface that the proxy class inherits the method through.an array of objects containing the values of the
arguments passed in the method invocation on the proxy instance,
or args)null if interface method takes no arguments.
Arguments of primitive types are wrapped in instances of the
appropriate primitive wrapper class, such as
java.lang.Integer or java.lang.Boolean.Implements java. Processes a method invocation on a proxy instance and returns the result. |
| closed | back to summary |
|---|---|
| protected boolean closed | |
| delegate | back to summary |
|---|---|
| protected Object delegate | |
| query | back to summary |
|---|---|
| protected final String query | |
| StatementProxy | back to summary |
|---|---|
| public StatementProxy(Object parent, String query) | |
| invoke | back to summary |
|---|---|
| public Object invoke(Object proxy, Method method, Object[] args) throws Throwable Implements java. Doc from java. Processes a method invocation on a proxy instance and returns the result. This method will be invoked on an invocation handler when a method is invoked on a proxy instance that it is associated with.
| |