Search in sources :

Example 1 with DataSourceKey

use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinDataSourceListBo.DataSourceKey in project pinpoint by naver.

the class ApplicationDataSourceService method classifyByDataSourceUrl.

protected Map<DataSourceKey, List<AggreJoinDataSourceBo>> classifyByDataSourceUrl(List<AggreJoinDataSourceListBo> aggreJoinDataSourceListBoList) {
    Map<DataSourceKey, List<AggreJoinDataSourceBo>> aggreJoinDataSourceBoMap = new HashMap<>();
    for (AggreJoinDataSourceListBo aggreJoinDataSourceListBo : aggreJoinDataSourceListBoList) {
        for (AggreJoinDataSourceBo aggreJoinDataSourceBo : aggreJoinDataSourceListBo.getAggreJoinDataSourceBoList()) {
            DataSourceKey dataSourceKey = new DataSourceKey(aggreJoinDataSourceBo.getUrl(), aggreJoinDataSourceBo.getServiceTypeCode());
            List<AggreJoinDataSourceBo> aggreJoinDataSourceBoList = aggreJoinDataSourceBoMap.computeIfAbsent(dataSourceKey, k -> new ArrayList<>());
            aggreJoinDataSourceBoList.add(aggreJoinDataSourceBo);
        }
    }
    for (List<AggreJoinDataSourceBo> aggreJoinDataSourceBoList : aggreJoinDataSourceBoMap.values()) {
        aggreJoinDataSourceBoList.sort(comparator);
    }
    return aggreJoinDataSourceBoMap;
}
Also used : DataSourceKey(com.navercorp.pinpoint.common.server.bo.stat.join.JoinDataSourceListBo.DataSourceKey) AggreJoinDataSourceListBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinDataSourceListBo) AggreJoinDataSourceBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinDataSourceBo)

Example 2 with DataSourceKey

use of com.navercorp.pinpoint.common.server.bo.stat.join.JoinDataSourceListBo.DataSourceKey in project pinpoint by naver.

the class ApplicationDataSourceService method selectApplicationChart.

public List<StatChart> selectApplicationChart(String applicationId, TimeWindow timeWindow) {
    Objects.requireNonNull(applicationId, "applicationId");
    Objects.requireNonNull(timeWindow, "timeWindow");
    List<StatChart> result = new ArrayList<>();
    List<AggreJoinDataSourceListBo> aggreJoinDataSourceListBoList = this.applicationDataSourceDao.getApplicationStatList(applicationId, timeWindow);
    if (aggreJoinDataSourceListBoList.isEmpty()) {
        result.add(new ApplicationDataSourceChart(timeWindow, "", "", Collections.emptyList()));
        return result;
    }
    Map<DataSourceKey, List<AggreJoinDataSourceBo>> aggreJoinDataSourceBoMap = classifyByDataSourceUrl(aggreJoinDataSourceListBoList);
    for (Map.Entry<DataSourceKey, List<AggreJoinDataSourceBo>> entry : aggreJoinDataSourceBoMap.entrySet()) {
        DataSourceKey dataSourceKey = entry.getKey();
        String serviceTypeName = serviceTypeRegistryService.findServiceType(dataSourceKey.getServiceTypeCode()).getName();
        result.add(new ApplicationDataSourceChart(timeWindow, dataSourceKey.getUrl(), serviceTypeName, entry.getValue()));
    }
    return result;
}
Also used : DataSourceKey(com.navercorp.pinpoint.common.server.bo.stat.join.JoinDataSourceListBo.DataSourceKey) ApplicationDataSourceChart(com.navercorp.pinpoint.web.vo.stat.chart.application.ApplicationDataSourceChart) AggreJoinDataSourceListBo(com.navercorp.pinpoint.web.vo.stat.AggreJoinDataSourceListBo) StatChart(com.navercorp.pinpoint.web.vo.stat.chart.StatChart)

Aggregations

DataSourceKey (com.navercorp.pinpoint.common.server.bo.stat.join.JoinDataSourceListBo.DataSourceKey)2 AggreJoinDataSourceListBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinDataSourceListBo)2 AggreJoinDataSourceBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinDataSourceBo)1 StatChart (com.navercorp.pinpoint.web.vo.stat.chart.StatChart)1 ApplicationDataSourceChart (com.navercorp.pinpoint.web.vo.stat.chart.application.ApplicationDataSourceChart)1