Class StatementTimer
java.lang.Object
com.kingsrook.qqq.backend.core.instrumentation.StatementTimer
Times one statement for
StatementExecutionListeners. Backend modules
call start() just before executing, succeeded(rows) after it returns, and
finish(sql) in a finally block; a statement never marked as succeeded is
reported as failed.
StatementTimer timer = StatementExecutionListeners.start(backend, table, StatementOperation.QUERY);
try { ...execute...; timer.succeeded(rowCount); }
finally { timer.finish(sql); }
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StatementTimerThe shared timer used while nobody listens; every method is a no-op. -
Method Summary
Modifier and TypeMethodDescriptionvoidfinish(CharSequence sql) Report the statement (once).The statement completed; rows read or affected when known.
-
Field Details
-
NOOP
The shared timer used while nobody listens; every method is a no-op.
-
-
Method Details
-
succeeded
The statement completed; rows read or affected when known. -
finish
Report the statement (once). Never throws.
-