use of com.alibaba.druid.support.http.stat.WebAppStatValue in project druid by alibaba.
the class MonitorClient method collectWebURI.
private void collectWebURI() {
if ((!collectWebAppEnable) && !collectWebURIEnable) {
return;
}
List<WebURIStatValue> webURIValueList = new ArrayList<WebURIStatValue>();
List<WebAppStatValue> webAppStatValueList = new ArrayList<WebAppStatValue>();
Set<Object> stats = WebAppStatManager.getInstance().getWebAppStatSet();
for (Object item : stats) {
if (!(item instanceof WebAppStat)) {
continue;
}
WebAppStat webAppStat = (WebAppStat) item;
if (collectWebAppEnable) {
WebAppStatValue webAppStatValue = webAppStat.getStatValue(true);
webAppStatValueList.add(webAppStatValue);
}
if (collectWebURIEnable) {
webURIValueList.addAll(webAppStat.getURIStatValueList(true));
}
}
MonitorContext ctx = createContext();
if (webURIValueList.size() > 0) {
dao.saveWebURI(ctx, webURIValueList);
}
if (webAppStatValueList.size() > 0) {
dao.saveWebApp(ctx, webAppStatValueList);
}
}
Aggregations