mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
增强监控
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@342 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -29,9 +29,9 @@ public class JdbcStatementStat implements JdbcStatementStatMBean {
|
||||
private final AtomicLong createCount = new AtomicLong(0); // 执行createStatement的计数
|
||||
private final AtomicLong prepareCount = new AtomicLong(0); // 执行parepareStatement的计数
|
||||
private final AtomicLong prepareCallCount = new AtomicLong(0); // 执行preCall的计数
|
||||
private final AtomicLong closeCount = new AtomicLong(0); // Statement关闭的计数
|
||||
private final AtomicLong closeCount = new AtomicLong(0); // Statement关闭的计数
|
||||
|
||||
private final AtomicInteger runningCount = new AtomicInteger();
|
||||
private final AtomicInteger runningCount = new AtomicInteger();
|
||||
private final AtomicInteger concurrentMax = new AtomicInteger();
|
||||
|
||||
private final AtomicLong count = new AtomicLong();
|
||||
@@ -80,6 +80,12 @@ public class JdbcStatementStat implements JdbcStatementStatMBean {
|
||||
lastSampleTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public void afterExecute(long nanoSpan) {
|
||||
runningCount.decrementAndGet();
|
||||
|
||||
nanoTotal.addAndGet(nanoSpan);
|
||||
}
|
||||
|
||||
public long getErrorCount() {
|
||||
return errorCount.get();
|
||||
}
|
||||
@@ -107,17 +113,11 @@ public class JdbcStatementStat implements JdbcStatementStatMBean {
|
||||
public long getNanoTotal() {
|
||||
return nanoTotal.get();
|
||||
}
|
||||
|
||||
|
||||
public long getMillisTotal() {
|
||||
return nanoTotal.get() / (1000 * 1000);
|
||||
}
|
||||
|
||||
public void afterExecute(long nanoSpan) {
|
||||
runningCount.decrementAndGet();
|
||||
|
||||
nanoTotal.addAndGet(nanoSpan);
|
||||
}
|
||||
|
||||
public Throwable getLastException() {
|
||||
return lastError;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user