Search in sources :

Example 1 with SampledActiveTrace

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

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

Example 3 with SampledActiveTrace

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;
}
Also used : BaseHistogramSchema(com.navercorp.pinpoint.common.trace.BaseHistogramSchema) HistogramSchema(com.navercorp.pinpoint.common.trace.HistogramSchema) ArrayList(java.util.ArrayList) SampledActiveTrace(com.navercorp.pinpoint.web.vo.stat.SampledActiveTrace) ActiveTraceBo(com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo) SlotType(com.navercorp.pinpoint.common.trace.SlotType)

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

Aggregations

SampledActiveTrace (com.navercorp.pinpoint.web.vo.stat.SampledActiveTrace)4 ActiveTraceBo (com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo)3 Range (com.navercorp.pinpoint.web.vo.Range)3 SampledAgentStatResultExtractor (com.navercorp.pinpoint.web.mapper.stat.SampledAgentStatResultExtractor)2 BaseHistogramSchema (com.navercorp.pinpoint.common.trace.BaseHistogramSchema)1 HistogramSchema (com.navercorp.pinpoint.common.trace.HistogramSchema)1 SlotType (com.navercorp.pinpoint.common.trace.SlotType)1 AgentStat (com.navercorp.pinpoint.web.vo.AgentStat)1 SampledCpuLoad (com.navercorp.pinpoint.web.vo.stat.SampledCpuLoad)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