mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
fixed testcase
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user