bug fixed sql runningCount & add statLog support

This commit is contained in:
wenshao
2013-05-18 22:01:29 +08:00
parent c9b2753985
commit 5f8b154bb2
12 changed files with 620 additions and 15 deletions
@@ -210,7 +210,7 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
private ObjectName objectName;
private final AtomicLong executeCount = new AtomicLong();
protected final AtomicLong executeCount = new AtomicLong();
protected volatile Throwable createError;
protected volatile Throwable lastError;
@@ -231,7 +231,10 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
private Boolean useUnfairLock = null;
private boolean useLocalSessionState = true;
private boolean useLocalSessionState = true;
protected long timeBetweenLogStatsMillis;
protected DruidDataSourceStatLogger statLogger = new DruidDataSourceStatLoggerImpl();
public DruidAbstractDataSource(boolean lockFair){
lock = new ReentrantLock(lockFair);
@@ -239,15 +242,23 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
notEmpty = lock.newCondition();
empty = lock.newCondition();
}
public boolean isUseLocalSessionState() {
return useLocalSessionState;
}
public void setUseLocalSessionState(boolean useLocalSessionState) {
this.useLocalSessionState = useLocalSessionState;
}
public long getTimeBetweenLogStatsMillis() {
return timeBetweenLogStatsMillis;
}
public void setTimeBetweenLogStatsMillis(long timeBetweenLogStatsMillis) {
this.timeBetweenLogStatsMillis = timeBetweenLogStatsMillis;
}
public boolean isOracle() {
return isOracle;
}