public static final class DefaultHook.ResultSetSize extends DefaultHook implements Hook.ResultSetRetrieval
DefaultHook.CloseConnection, DefaultHook.GetConnectionTimeout, DefaultHook.GetConnectionTiming, DefaultHook.InitConnection, DefaultHook.QueryTiming, DefaultHook.ResultSetSizeHook.CloseConnection, Hook.DestroyConnection, Hook.GetConnection, Hook.GetConnectionTimeout, Hook.InitConnection, Hook.MethodInvocation, Hook.ResultSetRetrieval, Hook.StatementExecution, Hook.StatementProceedingPoint| Constructor and Description |
|---|
ResultSetSize(ViburConfig config) |
| Modifier and Type | Method and Description |
|---|---|
void |
on(String sqlQuery,
List<Object[]> sqlQueryParams,
long resultSetSize,
long resultSetNanoTime)
An application hook that will be invoked at the end of each ResultSet retrieval as part of the
ResultSet.close() flow. |
public ResultSetSize(ViburConfig config)
public void on(String sqlQuery, List<Object[]> sqlQueryParams, long resultSetSize, long resultSetNanoTime)
Hook.ResultSetRetrievalResultSet.close() flow. For implementation details, see the comments for
ViburConfig.logLargeResultSet. The hook execution should take as short time as possible.on in interface Hook.ResultSetRetrievalsqlQuery - the executed SQL query or prepared/callable SQL statementsqlQueryParams - the executed SQL query params if ViburConfig.includeQueryParameters is enabled
and if the sqlQuery was a prepared/callable SQL statement; null otherwise.
The size of the parameters list is equal to the number of the question mark placeholders
in the PreparedStatement query. Each Object[] inside the list contains at index 0
the name of the invoked setXyz method (without the prefix "set") and at the following
indices the parameters of the invoked setXyz method; the last implies that the type of
the parameter at index 0 is always a String, and at index 1 is always an Integer (as the
first parameter of each setXyz method is always an int). For example, for the PreparedStatement
query select * from T1 where X=? and Y=? and Z>? where X is of type String,
Y is of type Integer, Z is of type java.sql.Date, and the supplied parameters values
are "street", "22", and "2007/10/15", the resultant sqlQueryParams list will
look like:
List {
Object[] {String("String"), Integer("1"), String("street")},
Object[] {String("Int"), Integer("2"), Integer("22")},
Object[] {String("Date"), Integer("3"), java.sql.Date("2007", "10", "15")}
}
resultSetSize - the retrieved ResultSet sizeresultSetNanoTime - the total time taken to iterate over and process the retrieved ResultSet; this is
the nanoseconds difference between the first and the last ResultSet.next()
calls, it includes the ResultSet network retrieval time, the JDBC driver
parsing time, plus any additional time taken by the application while
iterating over and processing this ResultSetCopyright © 2013-2019 vibur.org. All Rights Reserved.