Search in sources :

Example 1 with ActiveTraceHistogram

use of com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram in project pinpoint by naver.

the class GrpcActiveTraceBoMapper method map.

public ActiveTraceBo map(final PActiveTrace activeTrace) {
    final PActiveTraceHistogram histogram = activeTrace.getHistogram();
    final ActiveTraceHistogram activeTraceHistogram = createActiveTraceCountMap(histogram.getActiveTraceCountList());
    final ActiveTraceBo activeTraceBo = new ActiveTraceBo();
    activeTraceBo.setVersion((short) histogram.getVersion());
    activeTraceBo.setHistogramSchemaType(histogram.getHistogramSchemaType());
    activeTraceBo.setActiveTraceHistogram(activeTraceHistogram);
    return activeTraceBo;
}
Also used : ActiveTraceHistogram(com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram) PActiveTraceHistogram(com.navercorp.pinpoint.grpc.trace.PActiveTraceHistogram) PActiveTraceHistogram(com.navercorp.pinpoint.grpc.trace.PActiveTraceHistogram) ActiveTraceBo(com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo)

Example 2 with ActiveTraceHistogram

use of com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram in project pinpoint by naver.

the class ThriftActiveTraceBoMapperTest method verify.

@Override
protected void verify(TActiveTrace original, ActiveTraceBo mappedStatDataPoint) {
    Assert.assertEquals("version", original.getHistogram().getVersion(), mappedStatDataPoint.getVersion());
    Assert.assertEquals("schemaType", original.getHistogram().getHistogramSchemaType(), mappedStatDataPoint.getHistogramSchemaType());
    List<Integer> activeTraceCountList = original.getHistogram().getActiveTraceCount();
    for (int i = 0; i < activeTraceCountList.size(); i++) {
        int activeTraceCount = activeTraceCountList.get(i);
        final ActiveTraceHistogram activeTraceHistogram = mappedStatDataPoint.getActiveTraceHistogram();
        if (i == 0) {
            Assert.assertEquals("FAST", activeTraceCount, activeTraceHistogram.getFastCount());
        } else if (i == 1) {
            Assert.assertEquals("NORMAL", activeTraceCount, activeTraceHistogram.getNormalCount());
        } else if (i == 2) {
            Assert.assertEquals("SLOW", activeTraceCount, activeTraceHistogram.getSlowCount());
        } else if (i == 3) {
            Assert.assertEquals("VERY_SLOW", activeTraceCount, activeTraceHistogram.getVerySlowCount());
        } else {
            Assert.fail();
        }
    }
}
Also used : ActiveTraceHistogram(com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram) TActiveTraceHistogram(com.navercorp.pinpoint.thrift.dto.TActiveTraceHistogram)

Example 3 with ActiveTraceHistogram

use of com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram in project pinpoint by naver.

the class ActiveTraceSampler method sampleDataPoints.

@Override
public SampledActiveTrace sampleDataPoints(int timeWindowIndex, long timestamp, List<ActiveTraceBo> dataPoints, ActiveTraceBo previousDataPoint) {
    final HistogramSchema schema = BaseHistogramSchema.getDefaultHistogramSchemaByTypeCode(dataPoints.get(0).getHistogramSchemaType());
    if (schema == null) {
        return newUnSampledActiveTrace(timestamp);
    }
    AgentStatPoint<Integer> fast = newAgentStatPoint(schema.getFastSlot(), timestamp, dataPoints, ActiveTraceHistogram::getFastCount);
    AgentStatPoint<Integer> normal = newAgentStatPoint(schema.getNormalSlot(), timestamp, dataPoints, ActiveTraceHistogram::getNormalCount);
    AgentStatPoint<Integer> slow = newAgentStatPoint(schema.getSlowSlot(), timestamp, dataPoints, ActiveTraceHistogram::getSlowCount);
    AgentStatPoint<Integer> verySlow = newAgentStatPoint(schema.getVerySlowSlot(), timestamp, dataPoints, ActiveTraceHistogram::getVerySlowCount);
    SampledActiveTrace sampledActiveTrace = new SampledActiveTrace(fast, normal, slow, verySlow);
    return sampledActiveTrace;
}
Also used : BaseHistogramSchema(com.navercorp.pinpoint.common.trace.BaseHistogramSchema) HistogramSchema(com.navercorp.pinpoint.common.trace.HistogramSchema) ActiveTraceHistogram(com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram) SampledActiveTrace(com.navercorp.pinpoint.web.vo.stat.SampledActiveTrace)

Example 4 with ActiveTraceHistogram

use of com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram in project pinpoint by naver.

the class ThriftActiveTraceBoMapper method map.

@Override
public ActiveTraceBo map(TActiveTrace tActiveTrace) {
    TActiveTraceHistogram tActiveTraceHistogram = tActiveTrace.getHistogram();
    ActiveTraceHistogram activeTraceHistogram = createActiveTraceCountMap(tActiveTraceHistogram.getActiveTraceCount());
    ActiveTraceBo activeTraceBo = new ActiveTraceBo();
    activeTraceBo.setVersion(tActiveTraceHistogram.getVersion());
    activeTraceBo.setHistogramSchemaType(tActiveTraceHistogram.getHistogramSchemaType());
    activeTraceBo.setActiveTraceHistogram(activeTraceHistogram);
    return activeTraceBo;
}
Also used : TActiveTraceHistogram(com.navercorp.pinpoint.thrift.dto.TActiveTraceHistogram) ActiveTraceHistogram(com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram) TActiveTraceHistogram(com.navercorp.pinpoint.thrift.dto.TActiveTraceHistogram) ActiveTraceBo(com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo)

Example 5 with ActiveTraceHistogram

use of com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram in project pinpoint by naver.

the class ActiveTraceSampler method filterActiveTraceBoList.

private List<Integer> filterActiveTraceBoList(List<ActiveTraceBo> dataPoints, ToIntFunction<ActiveTraceHistogram> counter) {
    final List<Integer> result = new ArrayList<>(dataPoints.size());
    for (ActiveTraceBo activeTraceBo : dataPoints) {
        final ActiveTraceHistogram activeTraceHistogram = activeTraceBo.getActiveTraceHistogram();
        final int count = counter.applyAsInt(activeTraceHistogram);
        if (count != ActiveTraceBo.UNCOLLECTED_ACTIVE_TRACE_COUNT) {
            result.add(count);
        }
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) ActiveTraceHistogram(com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram) AgentStatPoint(com.navercorp.pinpoint.web.vo.stat.chart.agent.AgentStatPoint) TitledAgentStatPoint(com.navercorp.pinpoint.web.vo.stat.chart.agent.TitledAgentStatPoint) Point(com.navercorp.pinpoint.web.vo.chart.Point) ActiveTraceBo(com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo)

Aggregations

ActiveTraceHistogram (com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceHistogram)7 ActiveTraceBo (com.navercorp.pinpoint.common.server.bo.stat.ActiveTraceBo)5 TActiveTraceHistogram (com.navercorp.pinpoint.thrift.dto.TActiveTraceHistogram)2 TFActiveTraceHistogram (com.navercorp.pinpoint.thrift.dto.flink.TFActiveTraceHistogram)2 AgentStatBo (com.navercorp.pinpoint.common.server.bo.stat.AgentStatBo)1 BaseHistogramSchema (com.navercorp.pinpoint.common.trace.BaseHistogramSchema)1 HistogramSchema (com.navercorp.pinpoint.common.trace.HistogramSchema)1 PActiveTraceHistogram (com.navercorp.pinpoint.grpc.trace.PActiveTraceHistogram)1 TFActiveTrace (com.navercorp.pinpoint.thrift.dto.flink.TFActiveTrace)1 Point (com.navercorp.pinpoint.web.vo.chart.Point)1 SampledActiveTrace (com.navercorp.pinpoint.web.vo.stat.SampledActiveTrace)1 AgentStatPoint (com.navercorp.pinpoint.web.vo.stat.chart.agent.AgentStatPoint)1 TitledAgentStatPoint (com.navercorp.pinpoint.web.vo.stat.chart.agent.TitledAgentStatPoint)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1