添加ReusePreparedStatement计数

git-svn-id: http://code.alibabatech.com/svn/druid/trunk@913 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-09-28 15:15:51 +00:00
parent 9dff400ff6
commit 7ce7234f64
5 changed files with 43 additions and 6 deletions
@@ -178,6 +178,7 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
protected final AtomicLong commitCount = new AtomicLong();
protected final AtomicLong startTransactionCount = new AtomicLong();
protected final AtomicLong rollbackCount = new AtomicLong();
protected final AtomicLong reusePreparedStatement = new AtomicLong();
protected final Histogram transactionHistogram = new Histogram(
10,
@@ -189,6 +190,14 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
public Histogram getTransactionHistogram() {
return transactionHistogram;
}
public void incrementPreparedStatementCount() {
reusePreparedStatement.incrementAndGet();
}
public long getReusePreparedStatement() {
return reusePreparedStatement.get();
}
public long getTransactionThresholdMillis() {
return transactionThresholdMillis;
@@ -203,7 +212,7 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
public long[] getTransactionHistogramValues() {
return transactionHistogram.toArray();
}
public long[] getTransactionHistogramRanges() {
return transactionHistogram.getRanges();
}
@@ -569,10 +578,6 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
}
public void setPoolPreparedStatements(boolean poolPreparedStatements) {
if (inited) {
throw new UnsupportedOperationException();
}
this.poolPreparedStatements = poolPreparedStatements;
}