Search in sources :

Example 1 with ApplicationDataSourceChart

use of com.navercorp.pinpoint.web.vo.stat.chart.application.ApplicationDataSourceChart 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)1 AggreJoinDataSourceListBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinDataSourceListBo)1 StatChart (com.navercorp.pinpoint.web.vo.stat.chart.StatChart)1 ApplicationDataSourceChart (com.navercorp.pinpoint.web.vo.stat.chart.application.ApplicationDataSourceChart)1