Search in sources :

Example 6 with StatChart

use of com.navercorp.pinpoint.web.vo.stat.chart.StatChart in project pinpoint by naver.

the class AgentUriStatChartService method selectAgentChartList.

@Override
public List<StatChart> selectAgentChartList(String agentId, TimeWindow timeWindow) {
    Objects.requireNonNull(agentId, "agentId");
    Objects.requireNonNull(timeWindow, "timeWindow");
    List<SampledAgentUriStat> sampledAgentUriStatList = sampledAgentUriStatDao.getSampledAgentStatList(agentId, timeWindow);
    if (CollectionUtils.isEmpty(sampledAgentUriStatList)) {
        return Arrays.asList(new AgentUriStatChart(timeWindow, Collections.emptyList()));
    } else {
        List<StatChart> result = new ArrayList<>(sampledAgentUriStatList.size());
        for (SampledAgentUriStat sampledAgentUriStat : sampledAgentUriStatList) {
            result.add(new AgentUriStatChart(timeWindow, sampledAgentUriStat.getSampledEachUriStatBoList()));
        }
        Collections.sort(result, new Comparator<StatChart>() {

            @Override
            public int compare(StatChart o1, StatChart o2) {
                AgentUriStatChart chart1 = (AgentUriStatChart) o1;
                AgentUriStatChart chart2 = (AgentUriStatChart) o2;
                return Long.compare(chart2.getTotalCount(), chart1.getTotalCount());
            }
        });
        return result;
    }
}
Also used : ArrayList(java.util.ArrayList) AgentUriStatChart(com.navercorp.pinpoint.web.vo.stat.chart.agent.AgentUriStatChart) StatChart(com.navercorp.pinpoint.web.vo.stat.chart.StatChart) AgentUriStatChart(com.navercorp.pinpoint.web.vo.stat.chart.agent.AgentUriStatChart) SampledAgentUriStat(com.navercorp.pinpoint.web.vo.stat.SampledAgentUriStat)

Example 7 with StatChart

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

Example 8 with StatChart

use of com.navercorp.pinpoint.web.vo.stat.chart.StatChart in project pinpoint by naver.

the class CpuLoadChartService method selectAgentChartList.

@Override
public List<StatChart> selectAgentChartList(String agentId, TimeWindow timeWindow) {
    StatChart agentStatChart = selectAgentChart(agentId, timeWindow);
    List<StatChart> result = new ArrayList<>(1);
    result.add(agentStatChart);
    return result;
}
Also used : ArrayList(java.util.ArrayList) StatChart(com.navercorp.pinpoint.web.vo.stat.chart.StatChart)

Example 9 with StatChart

use of com.navercorp.pinpoint.web.vo.stat.chart.StatChart in project pinpoint by naver.

the class JvmGcChartService method selectAgentChartList.

@Override
public List<StatChart> selectAgentChartList(String agentId, TimeWindow timeWindow) {
    StatChart agentStatChart = selectAgentChart(agentId, timeWindow);
    List<StatChart> result = new ArrayList<>(1);
    result.add(agentStatChart);
    return result;
}
Also used : ArrayList(java.util.ArrayList) StatChart(com.navercorp.pinpoint.web.vo.stat.chart.StatChart)

Example 10 with StatChart

use of com.navercorp.pinpoint.web.vo.stat.chart.StatChart in project pinpoint by naver.

the class LoadedClassCountChartService method selectAgentChartList.

@Override
public List<StatChart> selectAgentChartList(String agentId, TimeWindow timeWindow) {
    StatChart agentStatChart = selectAgentChart(agentId, timeWindow);
    List<StatChart> result = new ArrayList<>(1);
    result.add(agentStatChart);
    return result;
}
Also used : ArrayList(java.util.ArrayList) StatChart(com.navercorp.pinpoint.web.vo.stat.chart.StatChart)

Aggregations

StatChart (com.navercorp.pinpoint.web.vo.stat.chart.StatChart)14 ArrayList (java.util.ArrayList)13 DataSourceKey (com.navercorp.pinpoint.common.server.bo.stat.join.JoinDataSourceListBo.DataSourceKey)1 AggreJoinDataSourceListBo (com.navercorp.pinpoint.web.vo.stat.AggreJoinDataSourceListBo)1 SampledAgentUriStat (com.navercorp.pinpoint.web.vo.stat.SampledAgentUriStat)1 SampledDataSourceList (com.navercorp.pinpoint.web.vo.stat.SampledDataSourceList)1 AgentUriStatChart (com.navercorp.pinpoint.web.vo.stat.chart.agent.AgentUriStatChart)1 DataSourceChart (com.navercorp.pinpoint.web.vo.stat.chart.agent.DataSourceChart)1 ApplicationDataSourceChart (com.navercorp.pinpoint.web.vo.stat.chart.application.ApplicationDataSourceChart)1