fixed testcase

This commit is contained in:
wenshao
2013-04-30 13:55:56 +08:00
parent 1b2ffe9d80
commit fc14629e95
47 changed files with 285 additions and 44 deletions
@@ -455,6 +455,10 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
if (useGloalDataSourceStat) {
dataSourceStat = JdbcDataSourceStat.getGlobal();
if (dataSourceStat == null) {
dataSourceStat = new JdbcDataSourceStat("Global", "Global", this.dbType);
JdbcDataSourceStat.setGlobal(dataSourceStat);
}
} else {
dataSourceStat = new JdbcDataSourceStat(this.name, this.jdbcUrl, this.dbType);
}
@@ -297,7 +297,7 @@ public final class JdbcStatManager implements JdbcStatManagerMBean {
TabularData data = new TabularDataSupport(tabularType);
JdbcDataSourceStat globalStat = JdbcDataSourceStat.getGlobal();
{
if (globalStat != null) {
Map<String, JdbcSqlStat> statMap = globalStat.getSqlStatMap();
for (Map.Entry<String, JdbcSqlStat> entry : statMap.entrySet()) {
if (entry.getValue().getExecuteCount() == 0 && entry.getValue().getRunningCount() == 0) {
@@ -335,7 +335,7 @@ public final class JdbcStatManager implements JdbcStatManagerMBean {
if (druidDataSourceStat == globalStat) {
continue;
}
Map<String, JdbcSqlStat> statMap = druidDataSourceStat.getSqlStatMap();
for (Map.Entry<String, JdbcSqlStat> entry : statMap.entrySet()) {
if (entry.getValue().getExecuteCount() == 0 && entry.getValue().getRunningCount() == 0) {