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;
}
}
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);
}
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;
}
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);
}
Aggregations