use of com.navercorp.pinpoint.web.vo.stat.SampledTransaction 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.SampledTransaction in project pinpoint by naver.
the class HbaseSampledTransactionDao method getSampledAgentStatList.
@Override
public List<SampledTransaction> getSampledAgentStatList(String agentId, TimeWindow timeWindow) {
long scanFrom = timeWindow.getWindowRange().getFrom();
long scanTo = timeWindow.getWindowRange().getTo() + timeWindow.getWindowSlotSize();
Range range = new Range(scanFrom, scanTo);
SampledAgentStatResultExtractor<TransactionBo, SampledTransaction> resultExtractor = new SampledAgentStatResultExtractor<>(timeWindow, mapper, transactionSampler);
return operations.getSampledAgentStatList(resultExtractor, agentId, range);
}
use of com.navercorp.pinpoint.web.vo.stat.SampledTransaction in project pinpoint by naver.
the class HbaseSampledTransactionDaoV2 method getSampledAgentStatList.
@Override
public List<SampledTransaction> getSampledAgentStatList(String agentId, TimeWindow timeWindow) {
long scanFrom = timeWindow.getWindowRange().getFrom();
long scanTo = timeWindow.getWindowRange().getTo() + timeWindow.getWindowSlotSize();
Range range = new Range(scanFrom, scanTo);
AgentStatMapperV2<TransactionBo> mapper = operations.createRowMapper(transactionDecoder, range);
SampledAgentStatResultExtractor<TransactionBo, SampledTransaction> resultExtractor = new SampledAgentStatResultExtractor<>(timeWindow, mapper, transactionSampler);
return operations.getSampledAgentStatList(AgentStatType.TRANSACTION, resultExtractor, agentId, range);
}
use of com.navercorp.pinpoint.web.vo.stat.SampledTransaction in project pinpoint by naver.
the class TransactionSampler method sampleDataPoints.
@Override
public SampledTransaction sampleDataPoints(int timeWindowIndex, long timestamp, List<TransactionBo> dataPoints, TransactionBo previousDataPoint) {
List<Double> sampledNews = new ArrayList<>(dataPoints.size());
List<Double> sampledContinuations = new ArrayList<>(dataPoints.size());
List<Double> unsampledNews = new ArrayList<>(dataPoints.size());
List<Double> unsampledContinuations = new ArrayList<>(dataPoints.size());
List<Double> totals = new ArrayList<>(dataPoints.size());
for (TransactionBo transactionBo : dataPoints) {
long collectInterval = transactionBo.getCollectInterval();
if (collectInterval > 0) {
boolean isTransactionCollected = false;
long totalCount = 0;
if (transactionBo.getSampledNewCount() != TransactionBo.UNCOLLECTED_VALUE) {
isTransactionCollected = true;
long sampledNewCount = transactionBo.getSampledNewCount();
sampledNews.add(calculateTps(sampledNewCount, collectInterval));
totalCount += sampledNewCount;
}
if (transactionBo.getSampledContinuationCount() != TransactionBo.UNCOLLECTED_VALUE) {
isTransactionCollected = true;
long sampledContinuationCount = transactionBo.getSampledContinuationCount();
sampledContinuations.add(calculateTps(sampledContinuationCount, collectInterval));
totalCount += sampledContinuationCount;
}
if (transactionBo.getUnsampledNewCount() != TransactionBo.UNCOLLECTED_VALUE) {
isTransactionCollected = true;
long unsampledNewCount = transactionBo.getUnsampledNewCount();
unsampledNews.add(calculateTps(unsampledNewCount, collectInterval));
totalCount += unsampledNewCount;
}
if (transactionBo.getUnsampledContinuationCount() != TransactionBo.UNCOLLECTED_VALUE) {
isTransactionCollected = true;
long unsampledContinuationCount = transactionBo.getUnsampledContinuationCount();
unsampledContinuations.add(calculateTps(unsampledContinuationCount, collectInterval));
totalCount += unsampledContinuationCount;
}
if (isTransactionCollected) {
totals.add(calculateTps(totalCount, collectInterval));
}
}
}
SampledTransaction sampledTransaction = new SampledTransaction();
sampledTransaction.setSampledNew(createPoint(timestamp, sampledNews));
sampledTransaction.setSampledContinuation(createPoint(timestamp, sampledContinuations));
sampledTransaction.setUnsampledNew(createPoint(timestamp, unsampledNews));
sampledTransaction.setUnsampledContinuation(createPoint(timestamp, unsampledContinuations));
sampledTransaction.setTotal(createPoint(timestamp, totals));
return sampledTransaction;
}
Aggregations