Search in sources :

Example 1 with WebURIStatValue

use of com.alibaba.druid.support.http.stat.WebURIStatValue 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);
    }
}
Also used : WebAppStatValue(com.alibaba.druid.support.http.stat.WebAppStatValue) ArrayList(java.util.ArrayList) WebURIStatValue(com.alibaba.druid.support.http.stat.WebURIStatValue) WebAppStat(com.alibaba.druid.support.http.stat.WebAppStat)

Aggregations

WebAppStat (com.alibaba.druid.support.http.stat.WebAppStat)1 WebAppStatValue (com.alibaba.druid.support.http.stat.WebAppStatValue)1 WebURIStatValue (com.alibaba.druid.support.http.stat.WebURIStatValue)1 ArrayList (java.util.ArrayList)1