@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 Object
implements org.apache.ibatis.plugin.Interceptor
性能分析拦截器,用于输出每条 SQL 语句及其执行时间
| 构造器和说明 |
|---|
PerformanceInterceptor() |
| 限定符和类型 | 方法和说明 |
|---|---|
long |
getMaxTime() |
Object |
intercept(org.apache.ibatis.plugin.Invocation invocation) |
boolean |
isFormat() |
boolean |
isWriteInLog() |
Object |
plugin(Object target) |
void |
setFormat(boolean format) |
void |
setMaxTime(long maxTime) |
void |
setProperties(Properties prop) |
void |
setWriteInLog(boolean writeInLog) |
public Object intercept(org.apache.ibatis.plugin.Invocation invocation) throws Throwable
intercept 在接口中 org.apache.ibatis.plugin.InterceptorThrowablepublic void setProperties(Properties prop)
setProperties 在接口中 org.apache.ibatis.plugin.Interceptorpublic long getMaxTime()
public void setMaxTime(long maxTime)
public boolean isFormat()
public void setFormat(boolean format)
public boolean isWriteInLog()
public void setWriteInLog(boolean writeInLog)
Copyright © 2017. All rights reserved.