mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
add spring stat support
This commit is contained in:
@@ -97,7 +97,7 @@ public class WebAppStatManager {
|
||||
Set<Object> stats = getWebAppStatSet();
|
||||
|
||||
for (Object stat : stats) {
|
||||
WebAppStatUtils.rset(stat);
|
||||
WebAppStatUtils.reset(stat);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,13 +59,14 @@ public class WebAppStatUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static void rset(Object webStat) {
|
||||
public static void reset(Object webStat) {
|
||||
if (webStat.getClass() == WebAppStat.class) {
|
||||
((WebAppStat) webStat).reset();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Method method = webStat.getClass().getMethod("rset");
|
||||
Method method = webStat.getClass().getMethod("reset");
|
||||
method.invoke(webStat);
|
||||
} catch (Exception e) {
|
||||
LOG.error("reset error", e);
|
||||
|
||||
@@ -67,7 +67,7 @@ public class SpringStatManager {
|
||||
Set<Object> stats = getSpringStatSet();
|
||||
|
||||
for (Object stat : stats) {
|
||||
SpringStatUtils.rset(stat);
|
||||
SpringStatUtils.reset(stat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,13 +27,14 @@ public class SpringStatUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static void rset(Object webStat) {
|
||||
public static void reset(Object webStat) {
|
||||
if (webStat.getClass() == SpringStat.class) {
|
||||
((SpringStat) webStat).reset();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Method method = webStat.getClass().getMethod("rset");
|
||||
Method method = webStat.getClass().getMethod("reset");
|
||||
method.invoke(webStat);
|
||||
} catch (Exception e) {
|
||||
LOG.error("reset error", e);
|
||||
|
||||
Reference in New Issue
Block a user