@Intercepts(value={@Signature(type=org.apache.ibatis.executor.statement.StatementHandler.class,method="query",args={java.sql.Statement.class,org.apache.ibatis.session.ResultHandler.class}),@Signature(type=org.apache.ibatis.executor.statement.StatementHandler.class,method="update",args=java.sql.Statement.class),@Signature(type=org.apache.ibatis.executor.statement.StatementHandler.class,method="batch",args=java.sql.Statement.class)})
public class PerformanceInterceptor
extends java.lang.Object
implements org.apache.ibatis.plugin.Interceptor
性能分析拦截器,用于输出每条 SQL 语句及其执行时间
| 构造器和说明 |
|---|
PerformanceInterceptor() |
| 限定符和类型 | 方法和说明 |
|---|---|
long |
getMaxTime() |
java.lang.reflect.Method |
getMethodRegular(java.lang.Class<?> clazz,
java.lang.String methodName) |
java.lang.Object |
intercept(org.apache.ibatis.plugin.Invocation invocation) |
boolean |
isFormat() |
boolean |
isWriteInLog() |
java.lang.Object |
plugin(java.lang.Object target) |
PerformanceInterceptor |
setFormat(boolean format) |
PerformanceInterceptor |
setMaxTime(long maxTime) |
void |
setProperties(java.util.Properties prop) |
PerformanceInterceptor |
setWriteInLog(boolean writeInLog) |
public java.lang.Object intercept(org.apache.ibatis.plugin.Invocation invocation)
throws java.lang.Throwable
intercept 在接口中 org.apache.ibatis.plugin.Interceptorjava.lang.Throwablepublic java.lang.Object plugin(java.lang.Object target)
plugin 在接口中 org.apache.ibatis.plugin.Interceptorpublic void setProperties(java.util.Properties prop)
setProperties 在接口中 org.apache.ibatis.plugin.Interceptorpublic long getMaxTime()
public PerformanceInterceptor setMaxTime(long maxTime)
public boolean isFormat()
public PerformanceInterceptor setFormat(boolean format)
public boolean isWriteInLog()
public PerformanceInterceptor setWriteInLog(boolean writeInLog)
public java.lang.reflect.Method getMethodRegular(java.lang.Class<?> clazz,
java.lang.String methodName)