Package com.pyranid
Class StatementLog<T>
java.lang.Object
com.pyranid.StatementLog<T>
A collection of SQL statement execution diagnostics.
- Since:
- 1.0.0
- Author:
- Mark Allen
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder used to construct instances ofStatementLog
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static <T> StatementLog.Builder
forStatementContext
(StatementContext<T> statementContext) Creates aStatementLog
builder for the givenstatementContext
.The size of the batch operation.How long did it take to acquire aConnection
from theDataSource
?The exception that occurred during SQL statement execution.How long did it take to execute the SQL statement?How long did it take to bind data to thePreparedStatement
?How long did it take to extract data from theResultSet
?The SQL statement that was executed.How long did it take to perform the database operation in total?int
hashCode()
toString()
-
Method Details
-
forStatementContext
@Nonnull public static <T> StatementLog.Builder forStatementContext(@Nonnull StatementContext<T> statementContext) Creates aStatementLog
builder for the givenstatementContext
.- Parameters:
statementContext
- current SQL context- Returns:
- a
StatementLog
builder
-
toString
-
equals
-
hashCode
-
getConnectionAcquisitionDuration
How long did it take to acquire aConnection
from theDataSource
?- Returns:
- how long it took to acquire a
Connection
, if available
-
getPreparationDuration
How long did it take to bind data to thePreparedStatement
?- Returns:
- how long it took to bind data to the
PreparedStatement
, if available
-
getExecutionDuration
How long did it take to execute the SQL statement?- Returns:
- how long it took to execute the SQL statement, if available
-
getResultSetMappingDuration
How long did it take to extract data from theResultSet
?- Returns:
- how long it took to extract data from the
ResultSet
, if available
-
getTotalDuration
How long did it take to perform the database operation in total?This is the sum of
getConnectionAcquisitionDuration()
+getPreparationDuration()
+getExecutionDuration()
+getResultSetMappingDuration()
.- Returns:
- how long the database operation took in total
-
getStatementContext
The SQL statement that was executed.- Returns:
- the SQL statement that was executed.
-
getBatchSize
The size of the batch operation.- Returns:
- how many records were processed as part of the batch operation, if available
-
getException
The exception that occurred during SQL statement execution.- Returns:
- the exception that occurred during SQL statement execution, if available
-