Search in sources :

Example 1 with SampledCpuLoad

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

the class LegacyAgentStatChartCompatibilityService method selectAgentStatList.

@Override
public LegacyAgentStatChartGroup selectAgentStatList(String agentId, TimeWindow timeWindow) {
    if (agentId == null) {
        throw new NullPointerException("agentId must not be null");
    }
    if (timeWindow == null) {
        throw new NullPointerException("timeWindow must not be null");
    }
    List<SampledJvmGc> jvmGcs = sampledJvmGcDao.getSampledAgentStatList(agentId, timeWindow);
    if (CollectionUtils.isNotEmpty(jvmGcs)) {
        List<SampledCpuLoad> cpuLoads = sampledCpuLoadDao.getSampledAgentStatList(agentId, timeWindow);
        List<SampledTransaction> transactions = sampledTransactionDao.getSampledAgentStatList(agentId, timeWindow);
        List<SampledActiveTrace> activeTraces = sampledActiveTraceDao.getSampledAgentStatList(agentId, timeWindow);
        LegacyAgentStatChartGroup.LegacyAgentStatChartGroupBuilder builder = new LegacyAgentStatChartGroup.LegacyAgentStatChartGroupBuilder(timeWindow);
        builder.jvmGcs(jvmGcs);
        builder.cpuLoads(cpuLoads);
        builder.transactions(transactions);
        builder.activeTraces(activeTraces);
        return builder.build();
    } else {
        long scanFrom = timeWindow.getWindowRange().getFrom();
        long scanTo = timeWindow.getWindowRange().getTo() + timeWindow.getWindowSlotSize();
        Range rangeToScan = new Range(scanFrom, scanTo);
        List<AgentStat> agentStats = legacyAgentStatDao.getAgentStatList(agentId, rangeToScan);
        LegacyAgentStatChartGroup chartGroup = new LegacyAgentStatChartGroup(timeWindow);
        chartGroup.addAgentStats(agentStats);
        chartGroup.buildCharts();
        return chartGroup;
    }
}
Also used : LegacyAgentStatChartGroup(com.navercorp.pinpoint.web.vo.stat.chart.LegacyAgentStatChartGroup) SampledActiveTrace(com.navercorp.pinpoint.web.vo.stat.SampledActiveTrace) Range(com.navercorp.pinpoint.web.vo.Range) SampledCpuLoad(com.navercorp.pinpoint.web.vo.stat.SampledCpuLoad) SampledTransaction(com.navercorp.pinpoint.web.vo.stat.SampledTransaction) AgentStat(com.navercorp.pinpoint.web.vo.AgentStat) SampledJvmGc(com.navercorp.pinpoint.web.vo.stat.SampledJvmGc)

Example 2 with SampledCpuLoad

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

the class HbaseSampledCpuLoadDaoV2 method getSampledAgentStatList.

@Override
public List<SampledCpuLoad> getSampledAgentStatList(String agentId, TimeWindow timeWindow) {
    long scanFrom = timeWindow.getWindowRange().getFrom();
    long scanTo = timeWindow.getWindowRange().getTo() + timeWindow.getWindowSlotSize();
    Range range = new Range(scanFrom, scanTo);
    AgentStatMapperV2<CpuLoadBo> mapper = operations.createRowMapper(cpuLoadDecoder, range);
    SampledAgentStatResultExtractor<CpuLoadBo, SampledCpuLoad> resultExtractor = new SampledAgentStatResultExtractor<>(timeWindow, mapper, cpuLoadSampler);
    return operations.getSampledAgentStatList(AgentStatType.CPU_LOAD, resultExtractor, agentId, range);
}
Also used : SampledCpuLoad(com.navercorp.pinpoint.web.vo.stat.SampledCpuLoad) CpuLoadBo(com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo) SampledAgentStatResultExtractor(com.navercorp.pinpoint.web.mapper.stat.SampledAgentStatResultExtractor) Range(com.navercorp.pinpoint.web.vo.Range)

Example 3 with SampledCpuLoad

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

the class CpuLoadSampler method sampleDataPoints.

@Override
public SampledCpuLoad sampleDataPoints(int timeWindowIndex, long timestamp, List<CpuLoadBo> dataPoints, CpuLoadBo previousDataPoint) {
    List<Double> jvmCpuLoads = new ArrayList<>(dataPoints.size());
    List<Double> systemCpuLoads = new ArrayList<>(dataPoints.size());
    for (CpuLoadBo cpuLoadBo : dataPoints) {
        if (cpuLoadBo.getJvmCpuLoad() != CpuLoadBo.UNCOLLECTED_VALUE) {
            jvmCpuLoads.add(cpuLoadBo.getJvmCpuLoad() * 100);
        }
        if (cpuLoadBo.getSystemCpuLoad() != CpuLoadBo.UNCOLLECTED_VALUE) {
            systemCpuLoads.add(cpuLoadBo.getSystemCpuLoad() * 100);
        }
    }
    SampledCpuLoad sampledCpuLoad = new SampledCpuLoad();
    sampledCpuLoad.setJvmCpuLoad(createPoint(timestamp, jvmCpuLoads));
    sampledCpuLoad.setSystemCpuLoad(createPoint(timestamp, systemCpuLoads));
    return sampledCpuLoad;
}
Also used : SampledCpuLoad(com.navercorp.pinpoint.web.vo.stat.SampledCpuLoad) CpuLoadBo(com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo) ArrayList(java.util.ArrayList)

Example 4 with SampledCpuLoad

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

the class HbaseSampledCpuLoadDao method getSampledAgentStatList.

@Override
public List<SampledCpuLoad> getSampledAgentStatList(String agentId, TimeWindow timeWindow) {
    long scanFrom = timeWindow.getWindowRange().getFrom();
    long scanTo = timeWindow.getWindowRange().getTo() + timeWindow.getWindowSlotSize();
    Range range = new Range(scanFrom, scanTo);
    SampledAgentStatResultExtractor<CpuLoadBo, SampledCpuLoad> resultExtractor = new SampledAgentStatResultExtractor<>(timeWindow, mapper, cpuLoadSampler);
    return operations.getSampledAgentStatList(resultExtractor, agentId, range);
}
Also used : SampledCpuLoad(com.navercorp.pinpoint.web.vo.stat.SampledCpuLoad) CpuLoadBo(com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo) SampledAgentStatResultExtractor(com.navercorp.pinpoint.web.mapper.stat.SampledAgentStatResultExtractor) Range(com.navercorp.pinpoint.web.vo.Range)

Aggregations

SampledCpuLoad (com.navercorp.pinpoint.web.vo.stat.SampledCpuLoad)4 CpuLoadBo (com.navercorp.pinpoint.common.server.bo.stat.CpuLoadBo)3 Range (com.navercorp.pinpoint.web.vo.Range)3 SampledAgentStatResultExtractor (com.navercorp.pinpoint.web.mapper.stat.SampledAgentStatResultExtractor)2 AgentStat (com.navercorp.pinpoint.web.vo.AgentStat)1 SampledActiveTrace (com.navercorp.pinpoint.web.vo.stat.SampledActiveTrace)1 SampledJvmGc (com.navercorp.pinpoint.web.vo.stat.SampledJvmGc)1 SampledTransaction (com.navercorp.pinpoint.web.vo.stat.SampledTransaction)1 LegacyAgentStatChartGroup (com.navercorp.pinpoint.web.vo.stat.chart.LegacyAgentStatChartGroup)1 ArrayList (java.util.ArrayList)1