This commit is contained in:
温少
2012-03-20 06:39:31 +08:00
parent 1e8e04da88
commit 0e40c7a5f3
2 changed files with 1 additions and 19 deletions
@@ -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>(