use of com.navercorp.pinpoint.web.vo.stat.SampledActiveTrace 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.SampledActiveTrace in project pinpoint by naver.
the class HbaseSampledActiveTraceDao method getSampledAgentStatList.
@Override
public List<SampledActiveTrace> getSampledAgentStatList(String agentId, TimeWindow timeWindow) {
long scanFrom = timeWindow.getWindowRange().getFrom();
long scanTo = timeWindow.getWindowRange().getTo() + timeWindow.getWindowSlotSize();
Range range = new Range(scanFrom, scanTo);
SampledAgentStatResultExtractor<ActiveTraceBo, SampledActiveTrace> resultExtractor = new SampledAgentStatResultExtractor<>(timeWindow, mapper, activeTraceSampler);
return operations.getSampledAgentStatList(resultExtractor, agentId, range);
}
use of com.navercorp.pinpoint.web.vo.stat.SampledActiveTrace in project pinpoint by naver.
the class ActiveTraceSampler method sampleDataPoints.
@Override
public SampledActiveTrace sampleDataPoints(int timeWindowIndex, long timestamp, List<ActiveTraceBo> dataPoints, ActiveTraceBo previousDataPoint) {
SampledActiveTrace sampledActiveTrace = new SampledActiveTrace();
HistogramSchema schema = BaseHistogramSchema.getDefaultHistogramSchemaByTypeCode(dataPoints.get(0).getHistogramSchemaType());
if (schema == null) {
sampledActiveTrace.setFastCounts(new UncollectedPoint<>(timestamp, ActiveTraceBo.UNCOLLECTED_ACTIVE_TRACE_COUNT));
sampledActiveTrace.setNormalCounts(new UncollectedPoint<>(timestamp, ActiveTraceBo.UNCOLLECTED_ACTIVE_TRACE_COUNT));
sampledActiveTrace.setSlowCounts(new UncollectedPoint<>(timestamp, ActiveTraceBo.UNCOLLECTED_ACTIVE_TRACE_COUNT));
sampledActiveTrace.setVerySlowCounts(new UncollectedPoint<>(timestamp, ActiveTraceBo.UNCOLLECTED_ACTIVE_TRACE_COUNT));
} else {
List<Integer> fastCounts = new ArrayList<>(dataPoints.size());
List<Integer> normalCounts = new ArrayList<>(dataPoints.size());
List<Integer> slowCounts = new ArrayList<>(dataPoints.size());
List<Integer> verySlowCounts = new ArrayList<>(dataPoints.size());
for (ActiveTraceBo activeTraceBo : dataPoints) {
Map<SlotType, Integer> activeTraceCounts = activeTraceBo.getActiveTraceCounts();
if (activeTraceCounts.get(SlotType.FAST) != ActiveTraceBo.UNCOLLECTED_ACTIVE_TRACE_COUNT) {
fastCounts.add(activeTraceCounts.get(SlotType.FAST));
}
if (activeTraceCounts.get(SlotType.NORMAL) != ActiveTraceBo.UNCOLLECTED_ACTIVE_TRACE_COUNT) {
normalCounts.add(activeTraceCounts.get(SlotType.NORMAL));
}
if (activeTraceCounts.get(SlotType.SLOW) != ActiveTraceBo.UNCOLLECTED_ACTIVE_TRACE_COUNT) {
slowCounts.add(activeTraceCounts.get(SlotType.SLOW));
}
if (activeTraceCounts.get(SlotType.VERY_SLOW) != ActiveTraceBo.UNCOLLECTED_ACTIVE_TRACE_COUNT) {
verySlowCounts.add(activeTraceCounts.get(SlotType.VERY_SLOW));
}
}
sampledActiveTrace.setFastCounts(createSampledTitledPoint(schema.getFastSlot().getSlotName(), timestamp, fastCounts));
sampledActiveTrace.setNormalCounts(createSampledTitledPoint(schema.getNormalSlot().getSlotName(), timestamp, normalCounts));
sampledActiveTrace.setSlowCounts(createSampledTitledPoint(schema.getSlowSlot().getSlotName(), timestamp, slowCounts));
sampledActiveTrace.setVerySlowCounts(createSampledTitledPoint(schema.getVerySlowSlot().getSlotName(), timestamp, verySlowCounts));
}
return sampledActiveTrace;
}
use of com.navercorp.pinpoint.web.vo.stat.SampledActiveTrace in project pinpoint by naver.
the class HbaseSampledActiveTraceDaoV2 method getSampledAgentStatList.
@Override
public List<SampledActiveTrace> getSampledAgentStatList(String agentId, TimeWindow timeWindow) {
long scanFrom = timeWindow.getWindowRange().getFrom();
long scanTo = timeWindow.getWindowRange().getTo() + timeWindow.getWindowSlotSize();
Range range = new Range(scanFrom, scanTo);
AgentStatMapperV2<ActiveTraceBo> mapper = operations.createRowMapper(activeTraceDecoder, range);
SampledAgentStatResultExtractor<ActiveTraceBo, SampledActiveTrace> resultExtractor = new SampledAgentStatResultExtractor<>(timeWindow, mapper, activeTraceSampler);
return operations.getSampledAgentStatList(AgentStatType.ACTIVE_TRACE, resultExtractor, agentId, range);
}
Aggregations