Search in sources :

Example 1 with SampledTransaction

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;
    }
}
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 SampledTransaction

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);
}
Also used : SampledTransaction(com.navercorp.pinpoint.web.vo.stat.SampledTransaction) SampledAgentStatResultExtractor(com.navercorp.pinpoint.web.mapper.stat.SampledAgentStatResultExtractor) Range(com.navercorp.pinpoint.web.vo.Range) TransactionBo(com.navercorp.pinpoint.common.server.bo.stat.TransactionBo)

Example 3 with SampledTransaction

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);
}
Also used : SampledTransaction(com.navercorp.pinpoint.web.vo.stat.SampledTransaction) SampledAgentStatResultExtractor(com.navercorp.pinpoint.web.mapper.stat.SampledAgentStatResultExtractor) Range(com.navercorp.pinpoint.web.vo.Range) TransactionBo(com.navercorp.pinpoint.common.server.bo.stat.TransactionBo)

Example 4 with SampledTransaction

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;
}
Also used : SampledTransaction(com.navercorp.pinpoint.web.vo.stat.SampledTransaction) ArrayList(java.util.ArrayList) TransactionBo(com.navercorp.pinpoint.common.server.bo.stat.TransactionBo)

Aggregations

SampledTransaction (com.navercorp.pinpoint.web.vo.stat.SampledTransaction)4 TransactionBo (com.navercorp.pinpoint.common.server.bo.stat.TransactionBo)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 SampledCpuLoad (com.navercorp.pinpoint.web.vo.stat.SampledCpuLoad)1 SampledJvmGc (com.navercorp.pinpoint.web.vo.stat.SampledJvmGc)1 LegacyAgentStatChartGroup (com.navercorp.pinpoint.web.vo.stat.chart.LegacyAgentStatChartGroup)1 ArrayList (java.util.ArrayList)1