Class SlowSqlListener
-
- All Implemented Interfaces:
-
java.io.Serializable,java.util.EventListener,org.jooq.ExecuteListener
public class SlowSqlListener implements ExecuteListenerLog the Slow Sql
- Since:
2021-01-14
trydofor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumSlowSqlListener.ContextKey
-
Field Summary
Fields Modifier and Type Field Description public Stringtokenpublic longthresholdMillispublic BiConsumer<Long, String>costAndSqlConsumer
-
Constructor Summary
Constructors Constructor Description SlowSqlListener()
-
Method Summary
Modifier and Type Method Description StringgetToken()voidsetToken(String token)longgetThresholdMillis()threshold of slow in mills, `-1` means disable voidsetThresholdMillis(long thresholdMillis)threshold of slow in mills, `-1` means disable BiConsumer<Long, String>getCostAndSqlConsumer()Handle time-consuming and SQL instead of logger voidsetCostAndSqlConsumer(BiConsumer<Long, String> costAndSqlConsumer)Handle time-consuming and SQL instead of logger voidstart(ExecuteContext ctx)voidend(ExecuteContext ctx)-
Methods inherited from class org.jooq.ExecuteListener
bindEnd, bindStart, exception, executeEnd, executeStart, fetchEnd, fetchStart, onBindEnd, onBindStart, onEnd, onException, onExecuteEnd, onExecuteStart, onFetchEnd, onFetchStart, onOutEnd, onOutStart, onPrepareEnd, onPrepareStart, onRecordEnd, onRecordStart, onRenderEnd, onRenderStart, onResultEnd, onResultStart, onStart, onWarning, outEnd, outStart, prepareEnd, prepareStart, recordEnd, recordStart, renderEnd, renderStart, resultEnd, resultStart, warning -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getThresholdMillis
long getThresholdMillis()
threshold of slow in mills, `-1` means disable
-
setThresholdMillis
void setThresholdMillis(long thresholdMillis)
threshold of slow in mills, `-1` means disable
-
getCostAndSqlConsumer
BiConsumer<Long, String> getCostAndSqlConsumer()
Handle time-consuming and SQL instead of logger
-
setCostAndSqlConsumer
void setCostAndSqlConsumer(BiConsumer<Long, String> costAndSqlConsumer)
Handle time-consuming and SQL instead of logger
-
start
void start(ExecuteContext ctx)
-
end
void end(ExecuteContext ctx)
-
-
-
-