final ConcurrentMap<String, DataSourceProxyImpl> dataSources = DruidDriver.getProxyDataSources();
for (DataSourceProxyImpl dataSource : dataSources.values()) {
for (Filter filter : dataSource.getConfig().getFilters()) {
if (filter instanceof StatFilter) {
StatFilter countFilter = (StatFilter) filter;
ConcurrentMap<Long, JdbcConnectionStat.Entry> connections = countFilter.getConnections();
for (Map.Entry<Long, JdbcConnectionStat.Entry> entry : connections.entrySet()) {
data.put(entry.getValue().getCompositeData());
}
}
}
}
for (DruidDataSource instance : DruidDataSourceStatManager.getDruidDataSourceInstances()) {
for (Filter filter : instance.getProxyFilters()) {
if (filter instanceof StatFilter) {
StatFilter countFilter = (StatFilter) filter;
ConcurrentMap<Long, JdbcConnectionStat.Entry> connections = countFilter.getConnections();
for (Map.Entry<Long, JdbcConnectionStat.Entry> entry : connections.entrySet()) {
data.put(entry.getValue().getCompositeData());
}
}
}