Search in sources :

Example 1 with SampledDataSourceList

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

the class SampledDataSourceResultExtractor method getSampleData.

private SampledDataSourceList getSampleData(List<DataSourceBo> dataSourceBoList) {
    dataSourceBoList.sort(Comparator.comparingLong(DataSourceBo::getTimestamp).reversed());
    AgentStatSamplingHandler<DataSourceBo, SampledDataSource> samplingHandler = new EagerSamplingHandler<>(timeWindow, sampler);
    for (DataSourceBo dataSourceBo : dataSourceBoList) {
        samplingHandler.addDataPoint(dataSourceBo);
    }
    List<SampledDataSource> sampledDataSources = samplingHandler.getSampledDataPoints();
    SampledDataSourceList sampledDataSourceList = new SampledDataSourceList();
    for (SampledDataSource sampledDataSource : sampledDataSources) {
        sampledDataSourceList.addSampledDataSource(sampledDataSource);
    }
    return sampledDataSourceList;
}
Also used : SampledDataSourceList(com.navercorp.pinpoint.web.vo.stat.SampledDataSourceList) SampledDataSource(com.navercorp.pinpoint.web.vo.stat.SampledDataSource) DataSourceBo(com.navercorp.pinpoint.common.server.bo.stat.DataSourceBo) EagerSamplingHandler(com.navercorp.pinpoint.web.mapper.stat.sampling.EagerSamplingHandler)

Example 2 with SampledDataSourceList

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

the class DataSourceChartService method selectAgentChartList.

@Override
public List<StatChart> selectAgentChartList(String agentId, TimeWindow timeWindow) {
    Objects.requireNonNull(agentId, "agentId");
    Objects.requireNonNull(timeWindow, "timeWindow");
    List<SampledDataSourceList> sampledAgentStatList = this.sampledDataSourceDao.getSampledAgentStatList(agentId, timeWindow);
    if (CollectionUtils.isEmpty(sampledAgentStatList)) {
        List<StatChart> result = new ArrayList<>(1);
        result.add(new DataSourceChart(timeWindow, Collections.emptyList(), serviceTypeRegistryService));
        return result;
    } else {
        List<StatChart> result = new ArrayList<>(sampledAgentStatList.size());
        for (SampledDataSourceList sampledDataSourceList : sampledAgentStatList) {
            result.add(new DataSourceChart(timeWindow, sampledDataSourceList.getSampledDataSourceList(), serviceTypeRegistryService));
        }
        return result;
    }
}
Also used : SampledDataSourceList(com.navercorp.pinpoint.web.vo.stat.SampledDataSourceList) DataSourceChart(com.navercorp.pinpoint.web.vo.stat.chart.agent.DataSourceChart) ArrayList(java.util.ArrayList) StatChart(com.navercorp.pinpoint.web.vo.stat.chart.StatChart)

Aggregations

SampledDataSourceList (com.navercorp.pinpoint.web.vo.stat.SampledDataSourceList)2 DataSourceBo (com.navercorp.pinpoint.common.server.bo.stat.DataSourceBo)1 EagerSamplingHandler (com.navercorp.pinpoint.web.mapper.stat.sampling.EagerSamplingHandler)1 SampledDataSource (com.navercorp.pinpoint.web.vo.stat.SampledDataSource)1 StatChart (com.navercorp.pinpoint.web.vo.stat.chart.StatChart)1 DataSourceChart (com.navercorp.pinpoint.web.vo.stat.chart.agent.DataSourceChart)1 ArrayList (java.util.ArrayList)1