Class StatementHistory
java.lang.Object
org.tentackle.dbms.StatementHistory
-
Constructor Summary
ConstructorsConstructorDescriptionStatementHistory(StatementWrapper statement, String sql) Creates a statement execution history. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyFetch(org.tentackle.misc.TimeKeeper fetchDuration, int fetchCount) Applies the fetch duration and number of rows fetched if statement is a query.voidend()Sets the execution end.Gets the batched parameter map.org.tentackle.misc.TimeKeeperGets the duration of the statement execution.longGets the start of execution in epochal milliseconds.intGets the number of rows fetched from the result set.org.tentackle.misc.TimeKeeperGets the duration to fetch the result from a query statement.static longGets the duration of statements to be logged as a warning.Gets the parameter map.getSql()Gets the sql string.Gets the transaction name.static voidsetLogMinDurationMillis(long logMinDurationMillis) Sets the duration of statements to be logged as a warning.toString()
-
Constructor Details
-
StatementHistory
Creates a statement execution history.- Parameters:
statement- the executed statementsql- optional SQL string if statement does not provide it
-
-
Method Details
-
setLogMinDurationMillis
public static void setLogMinDurationMillis(long logMinDurationMillis) Sets the duration of statements to be logged as a warning.- Parameters:
logMinDurationMillis- the duration in milliseconds, 0 to disable (default)
-
getLogMinDurationMillis
public static long getLogMinDurationMillis()Gets the duration of statements to be logged as a warning.- Returns:
- the duration in milliseconds
-
end
public void end()Sets the execution end. -
getExecutionStart
public long getExecutionStart()Gets the start of execution in epochal milliseconds.- Returns:
- the start
-
getExecutionDuration
public org.tentackle.misc.TimeKeeper getExecutionDuration()Gets the duration of the statement execution.- Returns:
- the duration, never null
-
applyFetch
public void applyFetch(org.tentackle.misc.TimeKeeper fetchDuration, int fetchCount) Applies the fetch duration and number of rows fetched if statement is a query.- Parameters:
fetchDuration- the fetch durationfetchCount- the number of rows fetched
-
getFetchDuration
public org.tentackle.misc.TimeKeeper getFetchDuration()Gets the duration to fetch the result from a query statement.- Returns:
- the duration, null if not a query
-
getFetchCount
public int getFetchCount()Gets the number of rows fetched from the result set.- Returns:
- the fetched rows (only valid if statement was a query)
- See Also:
-
getTxName
Gets the transaction name.- Returns:
- the tx name, null if none or no transaction
-
getParameters
-
getBatchParameters
-
getSql
-
toString
-