增强监控

git-svn-id: http://code.alibabatech.com/svn/druid/trunk@911 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-09-27 09:13:12 +00:00
parent 31fb63664a
commit a7f4299a4b
2 changed files with 5 additions and 2 deletions
@@ -170,6 +170,7 @@ public class DruidDataSourceStatManager implements DruidDataSourceStatManagerMBe
map.put("NotEmptyWaitCount", dataSource.getNotEmptyWaitCount());
map.put("NotEmptyWaitNanos", dataSource.getNotEmptyWaitNanos());
map.put("ErrorCount", dataSource.getErrorCount());
return new CompositeDataSupport(rowType, map);
}
@@ -189,7 +190,7 @@ public class DruidDataSourceStatManager implements DruidDataSourceStatManagerMBe
SimpleType.INTEGER, SimpleType.INTEGER, SimpleType.INTEGER, SimpleType.BOOLEAN, SimpleType.BOOLEAN, //
SimpleType.BOOLEAN, SimpleType.LONG, SimpleType.LONG, SimpleType.LONG, SimpleType.STRING, //
SimpleType.STRING, SimpleType.INTEGER, SimpleType.STRING, SimpleType.STRING, SimpleType.LONG, //
SimpleType.LONG, SimpleType.LONG,
SimpleType.LONG, SimpleType.LONG, SimpleType.LONG,
//
};
@@ -200,7 +201,7 @@ public class DruidDataSourceStatManager implements DruidDataSourceStatManagerMBe
"InitialSize", "MaxActive", "MinIdle", "PoolPreparedStatements", "TestOnBorrow", //
"TestOnReturn", "MinEvictableIdleTimeMillis", "ConnectErrorCount", "CreateTimespanMillis", "DbType", //
"ValidationQuery", "ValidationQueryTimeout", "DriverClassName", "Username", "RemoveAbandonedCount", //
"NotEmptyWaitCount", "NotEmptyWaitNanos"
"NotEmptyWaitCount", "NotEmptyWaitNanos", "ErrorCount"
//
};
@@ -67,6 +67,8 @@ public class DruidDataSourceFilterTest extends TestCase {
Assert.assertEquals(0, JdbcStatManager.getInstance().getConnectionstat().getCloseCount()); // logic
// close不会导致计数器+1
}
Assert.assertEquals(1, DruidDataSourceStatManager.getInstance().getDataSourceList().size());
dataSource.close();