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
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder used to construct instances ofStatementLog. -
Method Summary
Modifier and TypeMethodDescriptionbooleanThe size of the batch operation.How long did it take to acquire aConnectionfrom 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?inthashCode()toString()static <T> StatementLog.BuilderwithStatementContext(StatementContext<T> statementContext) Creates aStatementLogbuilder for the givenstatementContext.
-
Method Details
-
withStatementContext
@Nonnull public static <T> StatementLog.Builder withStatementContext(@Nonnull StatementContext<T> statementContext) Creates aStatementLogbuilder for the givenstatementContext.- Parameters:
statementContext- current SQL context- Returns:
- a
StatementLogbuilder
-
toString
-
equals
-
hashCode
-
getConnectionAcquisitionDuration
How long did it take to acquire aConnectionfrom 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
-
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
-