mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improve filter's config
This commit is contained in:
@@ -66,12 +66,17 @@ public class JdbcDataSourceStat implements JdbcDataSourceStatMBean {
|
||||
//
|
||||
});
|
||||
|
||||
private final ConcurrentMap<Long, JdbcConnectionStat.Entry> connections = new ConcurrentHashMap<Long, JdbcConnectionStat.Entry>(16, 0.75f, 1);
|
||||
private final ConcurrentMap<Long, JdbcConnectionStat.Entry> connections = new ConcurrentHashMap<Long, JdbcConnectionStat.Entry>(
|
||||
16,
|
||||
0.75f,
|
||||
1);
|
||||
|
||||
private final AtomicLong clobOpenCount = new AtomicLong();
|
||||
|
||||
private final AtomicLong blobOpenCount = new AtomicLong();
|
||||
|
||||
private boolean resetStatEnable = true;
|
||||
|
||||
private static JdbcDataSourceStat global;
|
||||
|
||||
static {
|
||||
@@ -92,6 +97,18 @@ public class JdbcDataSourceStat implements JdbcDataSourceStatMBean {
|
||||
public static void setGlobal(JdbcDataSourceStat value) {
|
||||
global = value;
|
||||
}
|
||||
|
||||
public void configFromProperties(Properties properties) {
|
||||
|
||||
}
|
||||
|
||||
public boolean isResetStatEnable() {
|
||||
return resetStatEnable;
|
||||
}
|
||||
|
||||
public void setResetStatEnable(boolean resetStatEnable) {
|
||||
this.resetStatEnable = resetStatEnable;
|
||||
}
|
||||
|
||||
public JdbcDataSourceStat(String name, String url){
|
||||
this(name, url, null);
|
||||
@@ -187,6 +204,10 @@ public class JdbcDataSourceStat implements JdbcDataSourceStatMBean {
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
if (!isResetStatEnable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
blobOpenCount.set(0);
|
||||
clobOpenCount.set(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user