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@911 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user