mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
refactor
This commit is contained in:
@@ -74,20 +74,10 @@ public class StatFilter extends FilterEventAdapter implements StatFilterMBean {
|
||||
|
||||
protected final AtomicLong resetCount = new AtomicLong();
|
||||
|
||||
protected int maxSqlStatCount = 1000 * 10;
|
||||
|
||||
// 3 seconds is slow sql
|
||||
protected long slowSqlMillis = 3 * 1000;
|
||||
|
||||
public StatFilter(){
|
||||
String property = System.getProperty("druid.stat.maxSqlStatCount");
|
||||
if (property != null && property.length() > 0) {
|
||||
try {
|
||||
maxSqlStatCount = Integer.parseInt(property);
|
||||
} catch (Exception e) {
|
||||
LOG.error("get property error 'druid.stat.maxSqlStatCount' : " + property);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isConnectionStackTraceEnable() {
|
||||
@@ -102,14 +92,6 @@ public class StatFilter extends FilterEventAdapter implements StatFilterMBean {
|
||||
return this.dataSourceStat;
|
||||
}
|
||||
|
||||
public int getMaxSqlStatCount() {
|
||||
return maxSqlStatCount;
|
||||
}
|
||||
|
||||
public void setMaxSqlStatCount(int maxSqlStatCount) {
|
||||
this.maxSqlStatCount = maxSqlStatCount;
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
dataSourceStat.reset();
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public class JdbcDataSourceStat implements JdbcDataSourceStatMBean {
|
||||
private final JdbcResultSetStat resultSetStat = new JdbcResultSetStat();
|
||||
private final JdbcStatementStat statementStat = new JdbcStatementStat();
|
||||
|
||||
private int maxSize = 2048;
|
||||
private int maxSize = 1000 * 10;
|
||||
|
||||
private ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
|
||||
private final LinkedHashMap<String, JdbcSqlStat> sqlStatMap = new LinkedHashMap<String, JdbcSqlStat>(
|
||||
|
||||
Reference in New Issue
Block a user